mermaid::support::logging::Logger Class Reference

Main class of the logger framework. More...

#include <Logger.hpp>

Inheritance diagram for mermaid::support::logging::Logger:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void begin (const std::string &message="")
 Logs a string with the level LOG_BEGIN.
void disableAllLogLevels ()
 Disables all outputs for all the levels, completely stopping the Logger.
void disableAllLogLevels (shared_ptr< LogOutput > logOutput)
 Disables all levels for the given output.
virtual void disableLogLevel (const LogLevel &logLevel)=0
 Disables all outputs for the specified logLevel.
virtual void disableLogLevel (const LogLevel &logLevel, shared_ptr< LogOutput > logOutput)=0
 Disables a specified output for a specific level.
void enableAllLogLevels (shared_ptr< LogOutput > logOutput)
 Enables all levels for the given output.
void enableErrorLogLevels (shared_ptr< LogOutput > logOutput)
 Enables the error levels (LOG_ERROR, LOG_WARN and LOG_INFO) for the given output.
virtual void enableLogLevel (const LogLevel &logLevel, shared_ptr< LogOutput > logOutput)=0
 Enables a specific output for a specific log level.
void enableReportingLogLevels (shared_ptr< LogOutput > logOutput)
 Enables the reporting levels (LOG_BEGIN, LOG_END, LOG_STEP and LOG_SEPARATOR) for the given output.
void end (const std::string &message="")
 Logs a string with the level LOG_END.
void error (const std::string &message)
 Logs a string with the level LOG_ERROR.
void info (const std::string &message)
 Logs a string with the level LOG_INFO.
void log (const LogLevel &logLevel, const mermaid::support::data::DataBox &message)
 Logs a DataBox.
virtual void log (const LogLevel &logLevel, const std::string &message)=0
 Logs a message, given in the form of a string.
void separator (const std::string &message="")
 Logs a string with the level LOG_SEPARATOR.
virtual void setPrefix (const std::string &prefix)=0
 Sets the prefix of the Logger.
void step (const std::string &message)
 Logs a string with the level LOG_STEP.
void warn (const std::string &message)
 Logs a string with the level LOG_WARN.

Detailed Description

Main class of the logger framework.

Author:
Joao Reis

Definition at line 313 of file Logger.hpp.


Member Function Documentation

void mermaid::support::logging::Logger::begin ( const std::string &  message = ""  )  [inline]

Logs a string with the level LOG_BEGIN.

Parameters:
message The message to log.
Author:
Joao Reis

Definition at line 840 of file Logger.hpp.

void Logger::disableAllLogLevels (  ) 

Disables all outputs for all the levels, completely stopping the Logger.

This method will stop the logger if you need it. It is necessary because you cannot delete the logger, it is always a shared_ptr.

Author:
Joao Reis

Definition at line 64 of file Logger.cpp.

void Logger::disableAllLogLevels ( shared_ptr< LogOutput logOutput  ) 

Disables all levels for the given output.

Parameters:
logOutput Will disable the levels for this logOutput.
Author:
Joao Reis

Definition at line 54 of file Logger.cpp.

virtual void mermaid::support::logging::Logger::disableLogLevel ( const LogLevel logLevel  )  [pure virtual]

Disables all outputs for the specified logLevel.

Parameters:
logLevel All the outputs of this level will be disabled.
Author:
Joao Reis

Implemented in mermaid::support::logging::ThreadSafeLogger, and mermaid::support::logging::FastLogger.

virtual void mermaid::support::logging::Logger::disableLogLevel ( const LogLevel logLevel,
shared_ptr< LogOutput logOutput 
) [pure virtual]

Disables a specified output for a specific level.

Parameters:
logLevel The logOutput will be disabled only for this level.
logOutput The logOutput to disble for the logLevel.
Author:
Joao Reis

Implemented in mermaid::support::logging::ThreadSafeLogger, and mermaid::support::logging::FastLogger.

void Logger::enableAllLogLevels ( shared_ptr< LogOutput logOutput  ) 

Enables all levels for the given output.

Parameters:
logOutput Will enable the levels for this logOutput.
Author:
Joao Reis

Definition at line 49 of file Logger.cpp.

void Logger::enableErrorLogLevels ( shared_ptr< LogOutput logOutput  ) 

Enables the error levels (LOG_ERROR, LOG_WARN and LOG_INFO) for the given output.

Parameters:
logOutput Will enable the levels for this logOutput.
Author:
Joao Reis

Definition at line 36 of file Logger.cpp.

virtual void mermaid::support::logging::Logger::enableLogLevel ( const LogLevel logLevel,
shared_ptr< LogOutput logOutput 
) [pure virtual]

Enables a specific output for a specific log level.

Parameters:
logLevel The logLevel to associate.
logOutput The logOutput to associate with the logLevel.
Author:
Joao Reis

Implemented in mermaid::support::logging::ThreadSafeLogger, and mermaid::support::logging::FastLogger.

void Logger::enableReportingLogLevels ( shared_ptr< LogOutput logOutput  ) 

Enables the reporting levels (LOG_BEGIN, LOG_END, LOG_STEP and LOG_SEPARATOR) for the given output.

Parameters:
logOutput Will enable the levels for this logOutput.
Author:
Joao Reis

Definition at line 42 of file Logger.cpp.

void mermaid::support::logging::Logger::end ( const std::string &  message = ""  )  [inline]

Logs a string with the level LOG_END.

Parameters:
message The message to log.
Author:
Joao Reis

Definition at line 852 of file Logger.hpp.

void mermaid::support::logging::Logger::error ( const std::string &  message  )  [inline]

Logs a string with the level LOG_ERROR.

Parameters:
message The message to log.
Author:
Joao Reis

Definition at line 827 of file Logger.hpp.

void mermaid::support::logging::Logger::info ( const std::string &  message  )  [inline]

Logs a string with the level LOG_INFO.

Parameters:
message The message to log.
Author:
Joao Reis

Definition at line 835 of file Logger.hpp.

void mermaid::support::logging::Logger::log ( const LogLevel logLevel,
const mermaid::support::data::DataBox message 
) [inline]

Logs a DataBox.

Please mind that this method is not affected by MERMAID_LOGGER_DISABLE_REPORTING.

Parameters:
logLevel The log level to use.
message The message to log.
Author:
Joao Reis

Definition at line 819 of file Logger.hpp.

virtual void mermaid::support::logging::Logger::log ( const LogLevel logLevel,
const std::string &  message 
) [pure virtual]

Logs a message, given in the form of a string.

This is the main method of the logger, all the others just call this one internally.

Please mind that this method is not affected by MERMAID_LOGGER_DISABLE_REPORTING.

Parameters:
logLevel The log level to use.
message The message to log.
Author:
Joao Reis

Implemented in mermaid::support::logging::ThreadSafeLogger, and mermaid::support::logging::FastLogger.

void mermaid::support::logging::Logger::separator ( const std::string &  message = ""  )  [inline]

Logs a string with the level LOG_SEPARATOR.

Parameters:
message The message to log.
Author:
Joao Reis

Definition at line 844 of file Logger.hpp.

virtual void mermaid::support::logging::Logger::setPrefix ( const std::string &  prefix  )  [pure virtual]

Sets the prefix of the Logger.

Each Logger can have exactly one prefix that is printed before every message.

Parameters:
prefix The prefix to use.
Author:
Joao Reis

Implemented in mermaid::support::logging::ThreadSafeLogger, and mermaid::support::logging::FastLogger.

void mermaid::support::logging::Logger::step ( const std::string &  message  )  [inline]

Logs a string with the level LOG_STEP.

Parameters:
message The message to log.
Author:
Joao Reis

Definition at line 848 of file Logger.hpp.

void mermaid::support::logging::Logger::warn ( const std::string &  message  )  [inline]

Logs a string with the level LOG_WARN.

Parameters:
message The message to log.
Author:
Joao Reis

Definition at line 831 of file Logger.hpp.

Generated on Fri Mar 4 22:15:49 2011 for MeRMaID::support by  doxygen 1.6.3