Tomographer  v4.0
Tomographer C++ Framework Documentation
Tomographer::Logger::FileLogger Class Reference

Simple logger class which logs everything into a given FILE pointer. More...

#include <tomographer/tools/loggers.h>

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

Public Member Functions

 FileLogger (FILE *fp_, int level=INFO, bool display_origin_=true)
 
void setFp (FILE *fp_)
 
void setLevel (int level)
 
void setDisplayOrigin (bool display_origin_)
 
void emitLog (int level, const char *origin, const std::string &msg)
 
- Public Member Functions inherited from Tomographer::Logger::LoggerBase< FileLogger >
 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 enabledFor (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< FileLogger >
enum  
 Shortcuts to properties defined in the traits class.
 
- Static Public Member Functions inherited from Tomographer::Logger::LoggerBase< FileLogger >
static bool staticallyEnabledFor (int level)
 Check whether the logger is statically disabled for some levels. More...
 
static bool staticallyEnabledFor ()
 Static version of staticallyEnabledFor() More...
 
- Protected Member Functions inherited from Tomographer::Logger::LoggerBase< FileLogger >
int getLevel () const
 
int getLevel () const
 
FileLoggerderived ()
 
const FileLoggerderived () const
 
void setLogLevel (int level)
 Store a new run-time log level. More...
 

Detailed Description

Simple logger class which logs everything into a given FILE pointer.

The FILE may be any C FILE* pointer, in particular stdin or stderr. If it is a file, it should be open and writeable.

You may set the given log level with setLevel().

Note
This class is thread-safe AS LONG AS you DO NOT CHANGE the target fp file pointer AND YOU DO NOT CHANGE the log level with setLevel()

Definition at line 1193 of file loggers.h.

Member Function Documentation

§ setDisplayOrigin()

void Tomographer::Logger::FileLogger::setDisplayOrigin ( bool  display_origin_)
inline
Warning
This method is not thread-safe!

Definition at line 1220 of file loggers.h.

§ setFp()

void Tomographer::Logger::FileLogger::setFp ( FILE *  fp_)
inline
Warning
This method is not thread-safe!

Definition at line 1204 of file loggers.h.

§ setLevel()

void Tomographer::Logger::FileLogger::setLevel ( int  level)
inline
Warning
This method is not thread-safe!

Definition at line 1212 of file loggers.h.


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