sptk2 logo
SPTK Home Page
Classes | Public Types | Public Member Functions | List of all members
sptk::Logger Class Reference

A log that sends all the log messages into another log. More...

#include <Logger.h>

Classes

struct  Message
 

Public Types

using UMessage = std::shared_ptr< Message >
 

Public Member Functions

 Logger (LogEngine &destination, String prefix="")
 Constructor. More...
 
LogEnginedestination ()
 Returns log engine (destination logger)
 
void log (LogPriority priority, const String &message)
 
void debug (const String &message)
 
void info (const String &message)
 
void notice (const String &message)
 
void warning (const String &message)
 
void error (const String &message)
 
void critical (const String &message)
 

Detailed Description

A log that sends all the log messages into another log.

The destination log is locked for a message adding period. Multiple Logger objects may send messages from different threads into the same destination log. The log options defining message format and min priority are used from destination log.

See also
CBaseLog for more information about basic log abilities.

Constructor & Destructor Documentation

◆ Logger()

sptk::Logger::Logger ( LogEngine destination,
String  prefix = "" 
)

Constructor.

Parameters
destinationDestination logger
prefixOptional log message prefix

Member Function Documentation

◆ critical()

void sptk::Logger::critical ( const String message)

Log message with critical priority

Parameters
messageMessage text

◆ debug()

void sptk::Logger::debug ( const String message)

Log message with debug priority

Parameters
messageMessage text

◆ error()

void sptk::Logger::error ( const String message)

Log message with error priority

Parameters
messageMessage text

◆ info()

void sptk::Logger::info ( const String message)

Log message with info priority

Parameters
messageMessage text

◆ log()

void sptk::Logger::log ( LogPriority  priority,
const String message 
)

Log message with any priority

Parameters
priorityMessage priority
messageMessage text

◆ notice()

void sptk::Logger::notice ( const String message)

Log message with notice priority

Parameters
messageMessage text

◆ warning()

void sptk::Logger::warning ( const String message)

Log message with warning priority

Parameters
messageMessage text

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

Fri Oct 14 2022 09:58:43: SPTK 5.4.1