Tomographer  v1.0a
Tomographer C++ Framework Documentation
Tomographer::Logger::MinimumSeverityLogger< BaseLogger, Level > Class Template Reference

Logger which statically discards any messages less important than a fixed severity. More...

#include <tomographer/tools/loggers.h>

+ Inheritance diagram for Tomographer::Logger::MinimumSeverityLogger< BaseLogger, Level >:
+ Collaboration diagram for Tomographer::Logger::MinimumSeverityLogger< BaseLogger, Level >:

Public Member Functions

 MinimumSeverityLogger (BaseLogger &baselogger_)
 Constructor from a base logger. More...
 
void emit_log (int level, const char *origin, const std::string &msg)
 Emit a log by relaying to the base logger.
 
int level () const
 Get the base logger's set level.
 
template<bool dummy = true>
std::enable_if< dummy &&LoggerTraits< BaseLogger >::HasFilterByOrigin, bool > filter_by_origin (int level, const char *origin)
 If relevant for the base logger, filter the messages by origin from the base logger.
 
- Public Member Functions inherited from Tomographer::Logger::LoggerBase< MinimumSeverityLogger< BaseLogger, Level > >
 LoggerBase (int level_=INFO)
 Construct the base logger object. More...
 
void error (const char *origin, const char *fmt,...)
 emit an error message More...
 
void error (const char *origin, const std::string &msg)
 emit an error message More...
 
void error (const char *origin, Fn f)
 emit an error message More...
 
void warning (const char *origin, const char *fmt,...)
 emit a warning message More...
 
void warning (const char *origin, const std::string &msg)
 emit a warning message More...
 
void warning (const char *origin, Fn f)
 emit a warning message More...
 
void info (const char *origin, const char *fmt,...)
 emit an information/notice message More...
 
void info (const char *origin, const std::string &msg)
 emit an information/notice message More...
 
void info (const char *origin, Fn f)
 emit an information/notice message More...
 
void debug (const char *origin, const char *fmt,...)
 emit an debug message More...
 
void debug (const char *origin, const std::string &msg)
 emit an debug message More...
 
void debug (const char *origin, Fn f)
 emit an debug message More...
 
void longdebug (const char *origin, const char *fmt,...)
 emit a very verbose debugging message More...
 
void longdebug (const char *origin, const std::string &msg)
 emit a very verbose debugging message More...
 
void longdebug (const char *origin, Fn f)
 emit a very verbose debugging message More...
 
void log (int level, const char *origin, const char *fmt,...)
 emit a log message at the given log level. More...
 
void log (int level, const char *origin, const std::string &msg)
 emit a log message at the given log level. More...
 
void log (int level, const char *origin, Fn f)
 emit a log message at the given log level. More...
 
void log (const char *origin, const char *fmt,...)
 emit a log message at the given log level. More...
 
void log (const char *origin, const char *fmt, va_list ap)
 emit a log message at the given log level. More...
 
void log (const char *origin, const std::string &msg)
 emit a log message at the given log level. More...
 
void log (const char *origin, Fn f)
 emit a log message at the given log level. More...
 
bool enabled_for (int level_) const
 Check whether messages at the given log level are enabled. More...
 
int level () const
 Get the log level set for this logger. More...
 

Additional Inherited Members

- Public Types inherited from Tomographer::Logger::LoggerBase< MinimumSeverityLogger< BaseLogger, Level > >
enum  
 Shortcuts to properties defined in the traits class.
 
- Static Public Member Functions inherited from Tomographer::Logger::LoggerBase< MinimumSeverityLogger< BaseLogger, Level > >
static bool statically_enabled_for (int level)
 Check whether the logger is statically disabled for some levels. More...
 
static bool statically_enabled_for ()
 Static version of statically_enabled_for() More...
 
- Protected Member Functions inherited from Tomographer::Logger::LoggerBase< MinimumSeverityLogger< BaseLogger, Level > >
int getLevel () const
 
int getLevel () const
 
MinimumSeverityLogger< BaseLogger, Level > * derived ()
 
const MinimumSeverityLogger< BaseLogger, Level > * derived () const
 
void setLogLevel (int level)
 Store a new run-time log level. More...
 

Detailed Description

template<typename BaseLogger, int Level>
class Tomographer::Logger::MinimumSeverityLogger< BaseLogger, Level >

Logger which statically discards any messages less important than a fixed severity.

This logger interfaces another logger of type BaseLogger, but will only log messages that are at least of severity Level. Other messages are discarded at compile-time, hopefully speeding up your code, also.

If BaseLogger is thread-safe, then this logger is also thread-safe.

Definition at line 1360 of file loggers.h.

Constructor & Destructor Documentation

template<typename BaseLogger , int Level>
Tomographer::Logger::MinimumSeverityLogger< BaseLogger, Level >::MinimumSeverityLogger ( BaseLogger &  baselogger_)
inline

Constructor from a base logger.

You must provide a reference to an instance of a logger, to which we will relay relevant calls.

Definition at line 1400 of file loggers.h.


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