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

#include <logging.h>

Public Member Functions

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

Static Public Member Functions

static log_level get_reporting_level ()
static void set_reporting_level (log_level lvl)
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 std::atomic< log_level > & reporting_level ()
static const char *const * get_log_level_cstr ()

Protected Attributes

std::string cat
std::ostringstream os

Detailed Description

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

the logger class

Definition at line 101 of file logging.h.

Constructor & Destructor Documentation

◆ ~Log()

template<typename T>
virtual logging::Log< T >::~Log ( )
inlinevirtual

the destructor

Definition at line 113 of file logging.h.

Member Function Documentation

◆ abort_on_fatal()

template<typename T>
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 164 of file logging.h.

◆ from_string()

template<typename T>
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 181 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 131 of file logging.h.

◆ get_last_log_level()

template<typename T>
std::atomic< log_level > & logging::Log< T >::get_last_log_level ( )
inlineprotected

Definition at line 217 of file logging.h.

◆ get_log_level_cstr()

template<typename T>
const char *const * logging::Log< T >::get_log_level_cstr ( )
inlinestaticprotected

Definition at line 221 of file logging.h.

◆ get_reporting_level()

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

get a reference to the configured logging level

Returns
the logging level

Definition at line 152 of file logging.h.

◆ print_severity()

template<typename T>
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 202 of file logging.h.

◆ print_time()

template<typename T>
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 193 of file logging.h.

◆ reporting_level()

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

get a reference to the configured logging level

Returns
the logging level

Definition at line 213 of file logging.h.

◆ set_reporting_level()

template<typename T>
void logging::Log< T >::set_reporting_level ( log_level lvl)
inlinestatic

get a reference to the configured logging level

Returns
the logging level

Definition at line 158 of file logging.h.

◆ to_string()

template<typename T>
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 174 of file logging.h.

Member Data Documentation

◆ cat

template<typename T>
std::string logging::Log< T >::cat
protected

Definition at line 222 of file logging.h.

◆ os

template<typename T>
std::ostringstream logging::Log< T >::os
protected

Definition at line 223 of file logging.h.


The documentation for this class was generated from the following file:
  • /home/eyck/Projects/MINRES/SystemC-Components/src/common/util/logging.h