Apama  10.15.1.2
com::softwareag::connectivity::Logger Class Reference

Class for writing to the system logger. More...

#include <sag_plugin_logging.hpp>

Public Types

typedef sag_log_level_t level_t
 The available log levels. More...
 

Public Member Functions

 Logger (const std::string &category)
 Construct a logger for the given category. More...
 
template<level_t LEVEL, typename... ARGS>
void log (const char *format, ARGS... args) const
 Log a message at a given level. More...
 
template<typename... ARGS>
void log (level_t LEVEL, const char *format, ARGS... args) const
 Log a message at a given level. More...
 
template<level_t LEVEL, typename... ARGS>
void log (const std::string &format, ARGS... args) const
 Log a message at a given level. More...
 
template<typename... ARGS>
void log (level_t LEVEL, const std::string &format, ARGS... args) const
 Log a message at a given level. More...
 
bool isEnabled (level_t LEVEL) const
 Returns true if messages at the given level will be written to the log file. More...
 
level_t getLevel () const
 Returns the current log level. More...
 
bool isCritEnabled () const
 Returns true if CRIT messages will be written to the log. More...
 
bool isFatalEnabled () const
 Returns true if FATAL messages will be written to the log. More...
 
bool isErrorEnabled () const
 Returns true if ERROR messages will be written to the log. More...
 
bool isWarnEnabled () const
 Returns true if WARN messages will be written to the log. More...
 
bool isInfoEnabled () const
 Returns true if INFO messages will be written to the log. More...
 
bool isDebugEnabled () const
 Returns true if DEBUG messages will be written to the log. More...
 
bool isTraceEnabled () const
 Returns true if TRACE messages will be written to the log. More...
 
template<typename... ARGS>
void crit (const char *format, ARGS... args) const
 Log a message at CRIT level. More...
 
template<typename... ARGS>
void fatal (const char *format, ARGS... args) const
 Log a message at FATAL level. More...
 
template<typename... ARGS>
void error (const char *format, ARGS... args) const
 Log a message at ERROR level. More...
 
template<typename... ARGS>
void warn (const char *format, ARGS... args) const
 Log a message at WARN level. More...
 
template<typename... ARGS>
void info (const char *format, ARGS... args) const
 Log a message at INFO level. More...
 
template<typename... ARGS>
void debug (const char *format, ARGS... args) const
 Log a message at DEBUG level. More...
 
template<typename... ARGS>
void trace (const char *format, ARGS... args) const
 Log a message at TRACE level. More...
 
void crit (const char *str) const
 Log a message at CRIT level without any arguments. More...
 
void fatal (const char *str) const
 Log a message at FATAL level without any arguments. More...
 
void error (const char *str) const
 Log a message at ERROR level without any arguments. More...
 
void warn (const char *str) const
 Log a message at WARN level without any arguments. More...
 
void info (const char *str) const
 Log a message at INFO level without any arguments. More...
 
void debug (const char *str) const
 Log a message at DEBUG level without any arguments. More...
 
void trace (const char *str) const
 Log a message at TRACE level without any arguments. More...
 
void crit (const std::string &str) const
 Log a message at CRIT level without any arguments. More...
 
void fatal (const std::string &str) const
 Log a message at FATAL level without any arguments. More...
 
void error (const std::string &str) const
 Log a message at ERROR level without any arguments. More...
 
void warn (const std::string &str) const
 Log a message at WARN level without any arguments. More...
 
void info (const std::string &str) const
 Log a message at INFO level without any arguments. More...
 
void debug (const std::string &str) const
 Log a message at DEBUG level without any arguments. More...
 
void trace (const std::string &str) const
 Log a message at TRACE level without any arguments. More...
 
template<typename... ARGS>
void crit (const std::string &format, ARGS... args) const
 Log a message at CRIT level. More...
 
template<typename... ARGS>
void fatal (const std::string &format, ARGS... args) const
 Log a message at FATAL level. More...
 
template<typename... ARGS>
void error (const std::string &format, ARGS... args) const
 Log a message at ERROR level. More...
 
template<typename... ARGS>
void warn (const std::string &format, ARGS... args) const
 Log a message at WARN level. More...
 
template<typename... ARGS>
void info (const std::string &format, ARGS... args) const
 Log a message at INFO level. More...
 
template<typename... ARGS>
void debug (const std::string &format, ARGS... args) const
 Log a message at DEBUG level. More...
 
template<typename... ARGS>
void trace (const std::string &format, ARGS... args) const
 Log a message at TRACE level. More...
 

Detailed Description

Class for writing to the system logger.

Log messages will be prefixed with the category.

Messages will appear for a certain log level if the system log level is at least as verbose.

Member Typedef Documentation

◆ level_t

Constructor & Destructor Documentation

◆ Logger()

com::softwareag::connectivity::Logger::Logger ( const std::string &  category)
inline

Construct a logger for the given category.

Member Function Documentation

◆ crit() [1/4]

template<typename... ARGS>
void com::softwareag::connectivity::Logger::crit ( const char *  format,
ARGS...  args 
) const
inline

Log a message at CRIT level.

◆ crit() [2/4]

void com::softwareag::connectivity::Logger::crit ( const char *  str) const
inline

Log a message at CRIT level without any arguments.

◆ crit() [3/4]

void com::softwareag::connectivity::Logger::crit ( const std::string &  str) const
inline

Log a message at CRIT level without any arguments.

◆ crit() [4/4]

template<typename... ARGS>
void com::softwareag::connectivity::Logger::crit ( const std::string &  format,
ARGS...  args 
) const
inline

Log a message at CRIT level.

◆ debug() [1/4]

template<typename... ARGS>
void com::softwareag::connectivity::Logger::debug ( const char *  format,
ARGS...  args 
) const
inline

Log a message at DEBUG level.

◆ debug() [2/4]

void com::softwareag::connectivity::Logger::debug ( const char *  str) const
inline

Log a message at DEBUG level without any arguments.

◆ debug() [3/4]

void com::softwareag::connectivity::Logger::debug ( const std::string &  str) const
inline

Log a message at DEBUG level without any arguments.

◆ debug() [4/4]

template<typename... ARGS>
void com::softwareag::connectivity::Logger::debug ( const std::string &  format,
ARGS...  args 
) const
inline

Log a message at DEBUG level.

◆ error() [1/4]

template<typename... ARGS>
void com::softwareag::connectivity::Logger::error ( const char *  format,
ARGS...  args 
) const
inline

Log a message at ERROR level.

◆ error() [2/4]

void com::softwareag::connectivity::Logger::error ( const char *  str) const
inline

Log a message at ERROR level without any arguments.

◆ error() [3/4]

void com::softwareag::connectivity::Logger::error ( const std::string &  str) const
inline

Log a message at ERROR level without any arguments.

◆ error() [4/4]

template<typename... ARGS>
void com::softwareag::connectivity::Logger::error ( const std::string &  format,
ARGS...  args 
) const
inline

Log a message at ERROR level.

◆ fatal() [1/4]

template<typename... ARGS>
void com::softwareag::connectivity::Logger::fatal ( const char *  format,
ARGS...  args 
) const
inline

Log a message at FATAL level.

◆ fatal() [2/4]

void com::softwareag::connectivity::Logger::fatal ( const char *  str) const
inline

Log a message at FATAL level without any arguments.

◆ fatal() [3/4]

void com::softwareag::connectivity::Logger::fatal ( const std::string &  str) const
inline

Log a message at FATAL level without any arguments.

◆ fatal() [4/4]

template<typename... ARGS>
void com::softwareag::connectivity::Logger::fatal ( const std::string &  format,
ARGS...  args 
) const
inline

Log a message at FATAL level.

◆ getLevel()

level_t com::softwareag::connectivity::Logger::getLevel ( ) const
inline

Returns the current log level.

◆ info() [1/4]

template<typename... ARGS>
void com::softwareag::connectivity::Logger::info ( const char *  format,
ARGS...  args 
) const
inline

Log a message at INFO level.

◆ info() [2/4]

void com::softwareag::connectivity::Logger::info ( const char *  str) const
inline

Log a message at INFO level without any arguments.

◆ info() [3/4]

void com::softwareag::connectivity::Logger::info ( const std::string &  str) const
inline

Log a message at INFO level without any arguments.

◆ info() [4/4]

template<typename... ARGS>
void com::softwareag::connectivity::Logger::info ( const std::string &  format,
ARGS...  args 
) const
inline

Log a message at INFO level.

◆ isCritEnabled()

bool com::softwareag::connectivity::Logger::isCritEnabled ( ) const
inline

Returns true if CRIT messages will be written to the log.

◆ isDebugEnabled()

bool com::softwareag::connectivity::Logger::isDebugEnabled ( ) const
inline

Returns true if DEBUG messages will be written to the log.

◆ isEnabled()

bool com::softwareag::connectivity::Logger::isEnabled ( level_t  LEVEL) const
inline

Returns true if messages at the given level will be written to the log file.

◆ isErrorEnabled()

bool com::softwareag::connectivity::Logger::isErrorEnabled ( ) const
inline

Returns true if ERROR messages will be written to the log.

◆ isFatalEnabled()

bool com::softwareag::connectivity::Logger::isFatalEnabled ( ) const
inline

Returns true if FATAL messages will be written to the log.

◆ isInfoEnabled()

bool com::softwareag::connectivity::Logger::isInfoEnabled ( ) const
inline

Returns true if INFO messages will be written to the log.

◆ isTraceEnabled()

bool com::softwareag::connectivity::Logger::isTraceEnabled ( ) const
inline

Returns true if TRACE messages will be written to the log.

◆ isWarnEnabled()

bool com::softwareag::connectivity::Logger::isWarnEnabled ( ) const
inline

Returns true if WARN messages will be written to the log.

◆ log() [1/4]

template<level_t LEVEL, typename... ARGS>
void com::softwareag::connectivity::Logger::log ( const char *  format,
ARGS...  args 
) const

Log a message at a given level.

Templated over the log level.

Should be called as:

log<SAG_LOG_CRIT>("format", args);

◆ log() [2/4]

template<typename... ARGS>
void com::softwareag::connectivity::Logger::log ( level_t  LEVEL,
const char *  format,
ARGS...  args 
) const

Log a message at a given level.

Level specified at runtime

Should be called as:

log(SAG_LOG_CRIT, "format", args);

◆ log() [3/4]

template<level_t LEVEL, typename... ARGS>
void com::softwareag::connectivity::Logger::log ( const std::string &  format,
ARGS...  args 
) const

Log a message at a given level.

Templated over the log level.

Should be called as:

log<SAG_LOG_CRIT>("format", args);

◆ log() [4/4]

template<typename... ARGS>
void com::softwareag::connectivity::Logger::log ( level_t  LEVEL,
const std::string &  format,
ARGS...  args 
) const

Log a message at a given level.

Level specified at runtime

Should be called as:

log(SAG_LOG_CRIT, "format", args);

◆ trace() [1/4]

template<typename... ARGS>
void com::softwareag::connectivity::Logger::trace ( const char *  format,
ARGS...  args 
) const
inline

Log a message at TRACE level.

◆ trace() [2/4]

void com::softwareag::connectivity::Logger::trace ( const char *  str) const
inline

Log a message at TRACE level without any arguments.

◆ trace() [3/4]

void com::softwareag::connectivity::Logger::trace ( const std::string &  str) const
inline

Log a message at TRACE level without any arguments.

◆ trace() [4/4]

template<typename... ARGS>
void com::softwareag::connectivity::Logger::trace ( const std::string &  format,
ARGS...  args 
) const
inline

Log a message at TRACE level.

◆ warn() [1/4]

template<typename... ARGS>
void com::softwareag::connectivity::Logger::warn ( const char *  format,
ARGS...  args 
) const
inline

Log a message at WARN level.

◆ warn() [2/4]

void com::softwareag::connectivity::Logger::warn ( const char *  str) const
inline

Log a message at WARN level without any arguments.

◆ warn() [3/4]

void com::softwareag::connectivity::Logger::warn ( const std::string &  str) const
inline

Log a message at WARN level without any arguments.

◆ warn() [4/4]

template<typename... ARGS>
void com::softwareag::connectivity::Logger::warn ( const std::string &  format,
ARGS...  args 
) const
inline

Log a message at WARN level.


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