Tomographer  v1.0a
Tomographer C++ Framework Documentation
Tomographer::Logger::BufferLogger Class Reference

Log messages into an internal memory buffer. More...

#include <tomographer/tools/loggers.h>

+ Inheritance diagram for Tomographer::Logger::BufferLogger:
+ Collaboration diagram for Tomographer::Logger::BufferLogger:

Public Member Functions

 BufferLogger (int level)
 
void emit_log (int, const char *origin, const std::string &msg)
 
void setLevel (int level)
 Changes the runtime log level to a new value. More...
 
void clear ()
 Clears the internal memory buffer. More...
 
std::string get_contents () const
 get the contents of the internal buffer More...
 
- Public Member Functions inherited from Tomographer::Logger::LoggerBase< BufferLogger >
 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< BufferLogger >
enum  
 Shortcuts to properties defined in the traits class.
 
- Static Public Member Functions inherited from Tomographer::Logger::LoggerBase< BufferLogger >
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< BufferLogger >
int getLevel () const
 
int getLevel () const
 
BufferLoggerderived ()
 
const BufferLoggerderived () const
 
void setLogLevel (int level)
 Store a new run-time log level. More...
 

Detailed Description

Log messages into an internal memory buffer.

Logs messages into an internal string buffer. The contents of the buffer may be retrieved with get_contents().

Definition at line 1312 of file loggers.h.

Member Function Documentation

void Tomographer::Logger::BufferLogger::clear ( )
inline

Clears the internal memory buffer.

Clears all messages logged so far. A future call to get_contents() will only return the messages logged after calling this function.

Definition at line 1341 of file loggers.h.

std::string Tomographer::Logger::BufferLogger::get_contents ( ) const
inline

get the contents of the internal buffer

This returns a string containing all the messages that have been logged so far.

Definition at line 1351 of file loggers.h.

void Tomographer::Logger::BufferLogger::setLevel ( int  level)
inline

Changes the runtime log level to a new value.

New messages will be emitted according to the new log level level.

Definition at line 1331 of file loggers.h.


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