scc  2024.06
SystemC components library
logging::Log< T > Class Template Reference

#include <logging.h>

Public Member Functions

 Log (const Log &)=delete
 
Logoperator= (const Log &)=delete
 
virtual ~Log ()
 the destructor
 
std::ostream & get (log_level level=INFO, const char *category="")
 

Static Public Member Functions

static std::atomic< log_level > & reporting_level ()
 
static log_level get_reporting_level ()
 
static std::atomic< bool > & abort_on_fatal ()
 
static std::string to_string (log_level level)
 
static log_level from_string (const std::string &level)
 
static std::atomic< bool > & print_time ()
 
static std::atomic< bool > & print_severity ()
 

Protected Member Functions

std::atomic< log_level > & get_last_log_level ()
 

Static Protected Member Functions

static const char *const * get_log_level_cstr ()
 

Protected Attributes

std::ostringstream os
 

Detailed Description

template<typename T>
class logging::Log< T >

the logger class

Definition at line 88 of file logging.h.

Member Function Documentation

◆ abort_on_fatal()

template<typename T >
static std::atomic<bool>& logging::Log< T >::abort_on_fatal ( )
inlinestatic

get a reference to the abort on fatal flag

Returns
the logging level

Definition at line 146 of file logging.h.

◆ from_string()

template<typename T >
static log_level logging::Log< T >::from_string ( const std::string &  level)
inlinestatic

parse a log level from a string

Parameters
levelthe string representing the log level
Returns
the log level

Definition at line 163 of file logging.h.

◆ get()

template<typename T >
std::ostream& logging::Log< T >::get ( log_level  level = INFO,
const char *  category = "" 
)
inline

get the underlying ostringstream for a certain log level and category

Parameters
levelthe log level
categorythe category string
Returns
the underlying output stream

Definition at line 114 of file logging.h.

◆ get_reporting_level()

template<typename T >
static log_level logging::Log< T >::get_reporting_level ( )
inlinestatic

get a reference to the configured logging level

Returns
the logging level

Definition at line 140 of file logging.h.

◆ print_severity()

template<typename T >
static std::atomic<bool>& logging::Log< T >::print_severity ( )
inlinestatic

get the reference to the flag indicating if severity should be part of the log

Returns
the print severity flag

Definition at line 184 of file logging.h.

◆ print_time()

template<typename T >
static std::atomic<bool>& logging::Log< T >::print_time ( )
inlinestatic

get the reference to the flag indicating if the current host time should be part of the log

Returns
the print time flag

Definition at line 175 of file logging.h.

◆ reporting_level()

template<typename T >
static std::atomic<log_level>& logging::Log< T >::reporting_level ( )
inlinestatic

get a reference to the configured logging level

Returns
the logging level

Definition at line 131 of file logging.h.

◆ to_string()

template<typename T >
static std::string logging::Log< T >::to_string ( log_level  level)
inlinestatic

translate a lg level to a string

Parameters
levelthe log level
Returns
the string representing the log level

Definition at line 156 of file logging.h.


The documentation for this class was generated from the following file: