Apama  10.3.0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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...
 
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

Constructor & Destructor Documentation

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

Construct a logger for the given category.

Member Function Documentation

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

Log a message at CRIT level.

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

Log a message at CRIT level.

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

Log a message at DEBUG level.

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

Log a message at DEBUG level.

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

Log a message at ERROR level.

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

Log a message at ERROR level.

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

Log a message at FATAL level.

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

Log a message at FATAL level.

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

Returns the current log level.

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

Log a message at INFO level.

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

Log a message at INFO level.

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

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

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

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

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.

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

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

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

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

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

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

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

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

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

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

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);

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);

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);

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);

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

Log a message at TRACE level.

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

Log a message at TRACE level.

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

Log a message at WARN level.

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: