Qore Logger Module Reference 0.6
Loading...
Searching...
No Matches
Logger::LoggerWrapper Class Reference

Class handling a LoggerInterface object as a member and providing atomic logging through it. More...

#include <Logger.qm.dox.h>

Inheritance diagram for Logger::LoggerWrapper:
[legend]

Public Member Methods

 assertLog (bool assertion, string message,...)
 Performs logging of assertions. More...
 
 constructor ()
 Creates the object with no logger.
 
 constructor (LoggerInterface logger)
 Creates the object with a logger.
 
 debug (string message,...)
 Logs a message object with the DEBUG level. More...
 
 debugVar (string var_name, auto value)
 Logs the variable name and value using DEBUG level. More...
 
 error (string message,...)
 Logs a message object with the ERROR level. More...
 
 fatal (string message,...)
 Logs a message object with the FATAL level. More...
 
 info (string message,...)
 Logs a message object with the INFO level. More...
 
bool isDebugEnabled ()
 Checks whether this Logger is enabled for the DEBUG Level.
 
bool isEnabledFor (int level)
 Checks whether this Logger is enabled for a given Level passed as parameter. More...
 
bool isEnabledFor (LoggerLevel level)
 Checks whether this Logger is enabled for a given Level passed as parameter. More...
 
bool isEnabledFor (string level)
 Checks whether this Logger is enabled for a given Level passed as parameter. More...
 
bool isErrorEnabled ()
 Checks whether this Logger is enabled for the ERROR Level.
 
bool isFatalEnabled ()
 Checks whether this Logger is enabled for the FATAL Level.
 
bool isInfoEnabled ()
 Checks whether this Logger is enabled for the INFO Level.
 
bool isTraceEnabled ()
 Checks whether this Logger is enabled for the TRACE Level.
 
bool isWarnEnabled ()
 Checks whether this Logger is enabled for the WARN Level.
 
 log (int level, string message)
 Logs a message using the provided logging level if a logger is set. More...
 
 log (LoggerLevel level, string message)
 Logs a message using the provided logging level if a logger is set. More...
 
 log (string level, string message)
 Logs a message using the provided logging level if a logger is set. More...
 
 logArgs (int level, string message, *softlist< auto > args)
 Logs a message using the provided logging level and a single argument for any format string arguments. More...
 
 logArgs (LoggerLevel level, string message, *softlist< auto > args)
 Logs a message using the provided logging level and a single argument for any format string arguments. More...
 
 logArgs (string level, string message, *softlist< auto > args)
 Logs a message using the provided logging level and a single argument for any format string arguments. More...
 
 logEvent (LoggerEvent event)
 Logs an already prepared logging event object. More...
 
 setLogger (*LoggerInterface logger)
 Accepts a LoggerInterface object for logging (or clears it)
 
 trace (string message,...)
 Logs a message object with the TRACE level. More...
 
 traceVar (string var_name, auto value)
 Logs the variable name and value using TRACE level. More...
 
 warn (string message,...)
 Logs a message object with the WARN level. More...
 
abstract assertLog (bool assertion, string message,...)
 Performs logging of assertions. More...
 
abstract debug (string message,...)
 Logs a message object with the DEBUG level. More...
 
abstract debugVar (string var_name, auto value)
 Logs the variable name and value using DEBUG level. More...
 
abstract error (string message,...)
 Logs a message object with the ERROR level. More...
 
abstract fatal (string message,...)
 Logs a message object with the FATAL level. More...
 
abstract info (string message,...)
 Logs a message object with the INFO level. More...
 
abstract bool isDebugEnabled ()
 Checks whether this Logger is enabled for the DEBUG Level.
 
abstract bool isEnabledFor (int level)
 Checks whether this Logger is enabled for a given Level passed as parameter. More...
 
abstract bool isEnabledFor (LoggerLevel level)
 Checks whether this Logger is enabled for a given Level passed as parameter. More...
 
abstract bool isEnabledFor (string level)
 Checks whether this Logger is enabled for a given Level passed as parameter. More...
 
abstract bool isErrorEnabled ()
 Checks whether this Logger is enabled for the ERROR Level.
 
abstract bool isFatalEnabled ()
 Checks whether this Logger is enabled for the FATAL Level.
 
abstract bool isInfoEnabled ()
 Checks whether this Logger is enabled for the INFO Level.
 
abstract bool isTraceEnabled ()
 Checks whether this Logger is enabled for the TRACE Level.
 
abstract bool isWarnEnabled ()
 Checks whether this Logger is enabled for the WARN Level.
 
abstract log (int level, string message)
 Logs a message using the provided logging level. More...
 
abstract log (LoggerLevel level, string message)
 Logs a message using the provided logging level. More...
 
abstract log (string level, string message)
 Logs a message using the provided logging level. More...
 
abstract logArgs (int level, string message, *softlist< auto > args)
 Logs a message using the provided logging level and a single argument for any format string arguments. More...
 
abstract logArgs (LoggerLevel level, string message, *softlist< auto > args)
 Logs a message using the provided logging level and a single argument for any format string arguments. More...
 
abstract logArgs (string level, string message, *softlist< auto > args)
 Logs a message using the provided logging level and a single argument for any format string arguments. More...
 
abstract logEvent (LoggerEvent event)
 Logs an already prepared logging event object. More...
 
abstract trace (string message,...)
 Logs a message object with the TRACE level. More...
 
abstract traceVar (string var_name, auto value)
 Logs the variable name and value using TRACE level. More...
 
abstract warn (string message,...)
 Logs a message object with the WARN level. More...
 

Private Attributes

transient *LoggerInterface logger
 The logger interface.
 

Detailed Description

Class handling a LoggerInterface object as a member and providing atomic logging through it.

Member Function Documentation

◆ assertLog()

Logger::LoggerWrapper::assertLog ( bool  assertion,
string  message,
  ... 
)
virtual

Performs logging of assertions.

If the assertion parameter is False, then the message is logged using the ERROR level.

See also
log()
Parameters
assertionthe boolean assertion value
messagea string to log used as a format string for vsprintf(). Optional arguments are passed to the LoggerEvent object. If the last parameter is an ExceptionInfo typed hash, then it is considered "throwable" information.

Implements Logger::LoggerInterface.

◆ debug()

Logger::LoggerWrapper::debug ( string  message,
  ... 
)
virtual

Logs a message object with the DEBUG level.

See also
log()
Parameters
messagea string to log used as a format string for vsprintf(). Optional arguments are passed to the LoggerEvent object. If the last parameter is an ExceptionInfo typed hash, then it is considered "throwable" information.

Implements Logger::LoggerInterface.

◆ debugVar()

Logger::LoggerWrapper::debugVar ( string  var_name,
auto  value 
)
virtual

Logs the variable name and value using DEBUG level.

See also
log()
Parameters
var_namethe variable name
valuethe value of the variable

Implements Logger::LoggerInterface.

◆ error()

Logger::LoggerWrapper::error ( string  message,
  ... 
)
virtual

Logs a message object with the ERROR level.

See also
log()
Parameters
messagea string to log used as a format string for vsprintf(). Optional arguments are passed to the LoggerEvent object. If the last parameter is an ExceptionInfo typed hash, then it is considered "throwable" information.

Implements Logger::LoggerInterface.

◆ fatal()

Logger::LoggerWrapper::fatal ( string  message,
  ... 
)
virtual

Logs a message object with the FATAL level.

See also
log()
Parameters
messagea string to log used as a format string for vsprintf(). Optional arguments are passed to the LoggerEvent object. If the last parameter is an ExceptionInfo typed hash, then it is considered "throwable" information.

Implements Logger::LoggerInterface.

◆ info()

Logger::LoggerWrapper::info ( string  message,
  ... 
)
virtual

Logs a message object with the INFO level.

See also
log()
Parameters
messagea string to log used as a format string for vsprintf(). Optional arguments are passed to the LoggerEvent object. If the last parameter is an ExceptionInfo typed hash, then it is considered "throwable" information.

Implements Logger::LoggerInterface.

◆ isEnabledFor() [1/3]

bool Logger::LoggerWrapper::isEnabledFor ( int  level)
virtual

Checks whether this Logger is enabled for a given Level passed as parameter.

Parameters
levelthe log level to check

Implements Logger::LoggerInterface.

◆ isEnabledFor() [2/3]

bool Logger::LoggerWrapper::isEnabledFor ( LoggerLevel  level)
virtual

Checks whether this Logger is enabled for a given Level passed as parameter.

Parameters
levelthe log level to check

Implements Logger::LoggerInterface.

◆ isEnabledFor() [3/3]

bool Logger::LoggerWrapper::isEnabledFor ( string  level)
virtual

Checks whether this Logger is enabled for a given Level passed as parameter.

Parameters
levelthe log level to check

Implements Logger::LoggerInterface.

◆ log() [1/3]

Logger::LoggerWrapper::log ( int  level,
string  message 
)
virtual

Logs a message using the provided logging level if a logger is set.

Parameters
levelthe logging level.
messagea string to log used as a format string for vsprintf(). Optional arguments are passed to the LoggerEvent object. If the last parameter is an ExceptionInfo typed hash, then it is considered "throwable" information.

Implements Logger::LoggerInterface.

◆ log() [2/3]

Logger::LoggerWrapper::log ( LoggerLevel  level,
string  message 
)
virtual

Logs a message using the provided logging level if a logger is set.

Parameters
levelThe logging level.
messagea string to log used as a format string for vsprintf(). Optional arguments are passed to the LoggerEvent object. If the last parameter is an ExceptionInfo typed hash, then it is considered "throwable" information.

Implements Logger::LoggerInterface.

◆ log() [3/3]

Logger::LoggerWrapper::log ( string  level,
string  message 
)
virtual

Logs a message using the provided logging level if a logger is set.

Parameters
levelThe logging level.
messagea string to log used as a format string for vsprintf(). Optional arguments are passed to the LoggerEvent object. If the last parameter is an ExceptionInfo typed hash, then it is considered "throwable" information.

Implements Logger::LoggerInterface.

◆ logArgs() [1/3]

Logger::LoggerWrapper::logArgs ( int  level,
string  message,
*softlist< auto >  args 
)
virtual

Logs a message using the provided logging level and a single argument for any format string arguments.

Logging is only performed if a logger is set

Parameters
levelthe logging level.
messagea string to log used as a format string for vsprintf(). Optional arguments are passed to the LoggerEvent object. If the last parameter is an ExceptionInfo typed hash, then it is considered "throwable" information.
argsany format string arguments to the log message

Implements Logger::LoggerInterface.

◆ logArgs() [2/3]

Logger::LoggerWrapper::logArgs ( LoggerLevel  level,
string  message,
*softlist< auto >  args 
)
virtual

Logs a message using the provided logging level and a single argument for any format string arguments.

Logging is only performed if a logger is set

Parameters
levelThe logging level.
messagea string to log used as a format string for vsprintf(). Optional arguments are passed to the LoggerEvent object. If the last parameter is an ExceptionInfo typed hash, then it is considered "throwable" information.
argsany format string arguments to the log message

Implements Logger::LoggerInterface.

◆ logArgs() [3/3]

Logger::LoggerWrapper::logArgs ( string  level,
string  message,
*softlist< auto >  args 
)
virtual

Logs a message using the provided logging level and a single argument for any format string arguments.

Logging is only performed if a logger is set

Parameters
levelThe logging level.
messagea string to log used as a format string for vsprintf(). Optional arguments are passed to the LoggerEvent object. If the last parameter is an ExceptionInfo typed hash, then it is considered "throwable" information.
argsany format string arguments to the log message

Implements Logger::LoggerInterface.

◆ logEvent()

Logger::LoggerWrapper::logEvent ( LoggerEvent  event)
virtual

Logs an already prepared logging event object.

Parameters
eventthe event to log

Implements Logger::LoggerInterface.

◆ trace()

Logger::LoggerWrapper::trace ( string  message,
  ... 
)
virtual

Logs a message object with the TRACE level.

See also
log()
Parameters
messagea string to log used as a format string for vsprintf(). Optional arguments are passed to the LoggerEvent object. If the last parameter is an ExceptionInfo typed hash, then it is considered "throwable" information.

Implements Logger::LoggerInterface.

◆ traceVar()

Logger::LoggerWrapper::traceVar ( string  var_name,
auto  value 
)
virtual

Logs the variable name and value using TRACE level.

See also
log()
Parameters
var_namethe variable name
valuethe value of the variable

Implements Logger::LoggerInterface.

◆ warn()

Logger::LoggerWrapper::warn ( string  message,
  ... 
)
virtual

Logs a message object with the WARN level.

See also
log()
Parameters
messagea string to log used as a format string for vsprintf(). Optional arguments are passed to the LoggerEvent object. If the last parameter is an ExceptionInfo typed hash, then it is considered "throwable" information.

Implements Logger::LoggerInterface.