Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
icl_core::logging::LoggingManager Class Reference

Manages the logging framework. More...

#include <LoggingManager.h>

Classes

struct  LogOutputStreamConfig
 Configuration of a LogOutputStream. More...
 
struct  LogStreamConfig
 Configuration of a LogStream. More...
 

Public Member Functions

void assertInitialized () const
 
void changeLogFormat (const icl_core::String &name, const char *format="~T ~S(~L)~ C~(O~::D: ~E")
 
void configure ()
 
void initialize ()
 
bool initialized () const
 
void printConfiguration () const
 
void registerLogOutputStream (const icl_core::String &name, LogOutputStreamFactory factory)
 
void registerLogStream (const icl_core::String &name, LogStreamFactory factory)
 
void registerLogStream (LogStream *log_stream)
 
void removeLogOutputStream (LogOutputStream *log_output_stream, bool remove_from_list=true)
 
void removeLogStream (const icl_core::String &log_stream_name)
 
void setLogLevel (icl_core::logging::LogLevel log_level)
 Set the log level globally for all existing streams. More...
 
void shutdown ()
 

Static Public Member Functions

static LoggingManagerinstance ()
 

Private Types

typedef icl_core::Map< icl_core::String, LogOutputStreamConfigLogOutputStreamConfigMap
 
typedef icl_core::Map< icl_core::String, LogOutputStreamFactoryLogOutputStreamFactoryMap
 
typedef icl_core::Map< icl_core::String, LogOutputStream * > LogOutputStreamMap
 
typedef icl_core::Map< icl_core::String, LogStreamConfigLogStreamConfigMap
 
typedef icl_core::Map< icl_core::String, LogStreamFactoryLogStreamFactoryMap
 
typedef icl_core::Map< icl_core::String, LogStream * > LogStreamMap
 
typedef icl_core::List< icl_core::StringStringList
 

Private Member Functions

 LoggingManager ()
 
 LoggingManager (const LoggingManager &)
 
LoggingManageroperator= (const LoggingManager &)
 
 ~LoggingManager ()
 

Private Attributes

LogOutputStreamm_default_log_output
 
bool m_initialized
 
LogOutputStreamFactoryMap m_log_output_stream_factories
 
LogOutputStreamMap m_log_output_streams
 
LogStreamConfigMap m_log_stream_config
 
LogStreamFactoryMap m_log_stream_factories
 
LogStreamMap m_log_streams
 
LogOutputStreamConfigMap m_output_stream_config
 
bool m_shutdown_running
 

Detailed Description

Manages the logging framework.

The logging framework can be configured through a call to Initialize(). It will then read its configuration via icl_core_config. See http://www.mca2.org/wiki/index.php/ProgMan:Logging for the details.

Definition at line 61 of file LoggingManager.h.

Member Typedef Documentation

Definition at line 241 of file LoggingManager.h.

Definition at line 268 of file LoggingManager.h.

Definition at line 270 of file LoggingManager.h.

Definition at line 251 of file LoggingManager.h.

Definition at line 269 of file LoggingManager.h.

Definition at line 267 of file LoggingManager.h.

Definition at line 225 of file LoggingManager.h.

Constructor & Destructor Documentation

icl_core::logging::LoggingManager::LoggingManager ( )
private

Definition at line 356 of file LoggingManager.cpp.

icl_core::logging::LoggingManager::~LoggingManager ( )
private

Definition at line 372 of file LoggingManager.cpp.

icl_core::logging::LoggingManager::LoggingManager ( const LoggingManager )
private

Member Function Documentation

void icl_core::logging::LoggingManager::assertInitialized ( ) const

Check if the logging manager has already been initialized. Aborts the program if not.

Definition at line 305 of file LoggingManager.cpp.

void icl_core::logging::LoggingManager::changeLogFormat ( const icl_core::String name,
const char *  format = "~T ~S(~L)~ C~(O~::D: ~E" 
)

Changes the log output format of the log output streams. See LogOutputStream::changeLogFormat for format definition

Definition at line 408 of file LoggingManager.cpp.

void icl_core::logging::LoggingManager::configure ( )

Configures log streams and log output streams.

This function is only useful if log streams are created dynamically after the logging manager has been initialized.

Definition at line 142 of file LoggingManager.cpp.

void icl_core::logging::LoggingManager::initialize ( )

Initializes the logging manager.

Remark: It is preferred to use the convenience functions icl_core::logging::initialize(), icl_core::logging::initialize(int&, char *[], bool) or icl_core::logging::initialize(int&, char *[], icl_core::config::Getopt::CommandLineCleaning, icl_core::config::Getopt::ParameterRegistrationCheck) instead of directly calling this method.

Definition at line 44 of file LoggingManager.cpp.

bool icl_core::logging::LoggingManager::initialized ( ) const
inline

Check if the logging manager has already been initialized.

Definition at line 91 of file LoggingManager.h.

static LoggingManager& icl_core::logging::LoggingManager::instance ( )
inlinestatic

Definition at line 64 of file LoggingManager.h.

LoggingManager& icl_core::logging::LoggingManager::operator= ( const LoggingManager )
private
void icl_core::logging::LoggingManager::printConfiguration ( ) const

Prints the configuration of log streams and log output streams.

Remark: This is mainly for debugging purposes!

Definition at line 377 of file LoggingManager.cpp.

void icl_core::logging::LoggingManager::registerLogOutputStream ( const icl_core::String name,
LogOutputStreamFactory  factory 
)

Registers a log output stream factory with the manager.

Definition at line 313 of file LoggingManager.cpp.

void icl_core::logging::LoggingManager::registerLogStream ( const icl_core::String name,
LogStreamFactory  factory 
)

Registers a log stream factory with the manager.

Definition at line 333 of file LoggingManager.cpp.

void icl_core::logging::LoggingManager::registerLogStream ( LogStream log_stream)

Registers a log stream with the manager.

Definition at line 338 of file LoggingManager.cpp.

void icl_core::logging::LoggingManager::removeLogOutputStream ( LogOutputStream log_output_stream,
bool  remove_from_list = true 
)

Removes a log output stream from the logging manager.

Definition at line 318 of file LoggingManager.cpp.

void icl_core::logging::LoggingManager::removeLogStream ( const icl_core::String log_stream_name)

Removes a log stream from the logging manager.

Definition at line 348 of file LoggingManager.cpp.

void icl_core::logging::LoggingManager::setLogLevel ( icl_core::logging::LogLevel  log_level)

Set the log level globally for all existing streams.

Definition at line 291 of file LoggingManager.cpp.

void icl_core::logging::LoggingManager::shutdown ( )

Shuts down the logging framework. Any log messages that are pending in log output streams are written out. The log output stream threads are then stopped so that no further log messages are processed.

Definition at line 420 of file LoggingManager.cpp.

Member Data Documentation

LogOutputStream* icl_core::logging::LoggingManager::m_default_log_output
private

Definition at line 276 of file LoggingManager.h.

bool icl_core::logging::LoggingManager::m_initialized
private

Definition at line 261 of file LoggingManager.h.

LogOutputStreamFactoryMap icl_core::logging::LoggingManager::m_log_output_stream_factories
private

Definition at line 272 of file LoggingManager.h.

LogOutputStreamMap icl_core::logging::LoggingManager::m_log_output_streams
private

Definition at line 274 of file LoggingManager.h.

LogStreamConfigMap icl_core::logging::LoggingManager::m_log_stream_config
private

Definition at line 265 of file LoggingManager.h.

LogStreamFactoryMap icl_core::logging::LoggingManager::m_log_stream_factories
private

Definition at line 273 of file LoggingManager.h.

LogStreamMap icl_core::logging::LoggingManager::m_log_streams
private

Definition at line 271 of file LoggingManager.h.

LogOutputStreamConfigMap icl_core::logging::LoggingManager::m_output_stream_config
private

Definition at line 264 of file LoggingManager.h.

bool icl_core::logging::LoggingManager::m_shutdown_running
private

Definition at line 262 of file LoggingManager.h.


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


fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:59