COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
Logger Class Reference

Main class of the logging system. More...

#include <Log.hpp>

Inherits noncopyable.

Public Member Functions

void initiate ()
 Initiates the log environment base on the Environment component maintained by the Core. More...
 
LogStreamInfo (const CodeLocation &place)
 Gives the info stream. More...
 
LogStreamError (const CodeLocation &place)
 Gives the error stream. More...
 
LogStreamWarn (const CodeLocation &place)
 Gives the warning stream. More...
 
LogStreamDebug (const CodeLocation &place)
 Gives the debug stream. More...
 
LogStreamgetStream (LogLevel type)
 
void openFiles ()
 Creates file descriptors and gives them to streams. More...
 
void set_log_level (const Uint log_level)
 

Static Public Member Functions

static Loggerinstance ()
 Gives the current Logger instance. More...
 
static std::string type_name ()
 

Private Member Functions

 Logger ()
 Constructor. More...
 
 ~Logger ()
 Destructor. More...
 

Private Attributes

std::map< LogLevel, LogStream * > m_streams
 Managed streams. More...
 

Detailed Description

Main class of the logging system.

This class manages all streams used for logs. This class is a singleton.
Logger manages 4 streams: info, error, warning, debug. These streams differ on the type of messages they forward. By default, only streams ERROR, WARNING, INFO will be outputted. This can be changed using Logger::set_log_level(). By default no file is open. Once an MPI environment has been initialized, openFiles() can be called. Two files descriptors are created: one for a log file and another one for a trace file; respectively output-pi.log and output-pi.trace, where i if the MPI rank number).

See also
LogStream
Author
Quentin Gasper

Definition at line 38 of file Log.hpp.

Constructor & Destructor Documentation

Logger ( )
private

Constructor.

Definition at line 39 of file Log.cpp.

~Logger ( )
private

Destructor.

Definition at line 53 of file Log.cpp.

Member Function Documentation

LogStream & Debug ( const CodeLocation place)

Gives the debug stream.

Parameters
placeThe code location from where this method was called
Returns
Returns a reference to the debug stream.

Definition at line 104 of file Log.cpp.

LogStream & Error ( const CodeLocation place)

Gives the error stream.

Parameters
placeThe code location from where this method was called
Returns
Returns a reference to the error stream.

Definition at line 90 of file Log.cpp.

LogStream & getStream ( LogLevel  type)

Definition at line 111 of file Log.cpp.

LogStream & Info ( const CodeLocation place)

Gives the info stream.

Parameters
placeThe code location from where this method was called
Returns
Returns a reference to the info stream.

Definition at line 83 of file Log.cpp.

void initiate ( )

Initiates the log environment base on the Environment component maintained by the Core.

Definition at line 71 of file Log.cpp.

Logger & instance ( )
static

Gives the current Logger instance.

If no instance exists, a new one is created.

Returns
Returns the current instance.

Definition at line 63 of file Log.cpp.

void openFiles ( )

Creates file descriptors and gives them to streams.

Definition at line 118 of file Log.cpp.

void set_log_level ( const Uint  log_level)

Definition at line 142 of file Log.cpp.

static std::string type_name ( )
inlinestatic
Returns
the class name

Definition at line 53 of file Log.hpp.

LogStream & Warn ( const CodeLocation place)

Gives the warning stream.

Parameters
placeThe code location from where this method was called
Returns
Returns a reference to the warning stream.

Definition at line 97 of file Log.cpp.

Member Data Documentation

std::map<LogLevel, LogStream *> m_streams
private

Managed streams.

The key is the stream type. The value is a pointer to the stream.

Definition at line 88 of file Log.hpp.


The documentation for this class was generated from the following files:
Send comments to:
COOLFluiD Web Admin