Valkka
1.6.1
OpenSource Video Management
|
Logging facility. More...
#include <logging.h>
Public Types | |
typedef Logger &(* | LoggerManipulator) (Logger &) |
typedef std::basic_ostream< char, std::char_traits< char > > | CoutType |
typedef CoutType &(* | StandardEndLine) (CoutType &) |
Public Member Functions | |
Logger (int log_level=LogLevel::normal) | |
template<typename T > | |
Logger & | operator<< (const T &x) |
void | setLevel (int level) |
Logger & | log (int level) |
Logger & | operator<< (LoggerManipulator manip) |
Logger & | operator<< (StandardEndLine manip) |
Static Public Member Functions | |
static Logger & | endl (Logger &stream) |
Public Attributes | |
int | log_level |
int | current_level |
Logging facility.
logger.log(LogLevel::crazy) << a << b << c << etc. gets evaluated as:
( ( (logger.log(LogLevel::crazy)) << a) << b ) << c )
so first, logger.log(LogLevel::crazy) returns an object that consumers a, which returns an object that consumes b, etc.
For extremely frequent logging, just use std::cout encapsulated inside preprocessor statements