#include <log.hpp>
Public Member Functions | |
logger (std::ostream &os) | |
logger & | operator() (log_type type) |
template<class T> | |
logger & | operator<< (const T &arg) |
logger & | operator<< (std::ostream &(*pf)(std::ostream &)) |
void | add_log_type (log_type type) |
template<class Con> | |
void | log_all (const Con &con, const std::string &delim) |
Static Public Member Functions | |
log_type | get_log_type (const std::string &name) |
std::string | get_log_name (const log_type &type) |
Private Attributes | |
std::ostream & | os |
std::set< log_type > | log_types |
bool | logger_valid |
Friends | |
std::ostream & | operator<< (std::ostream &os, const logger &l) |
|
Constructor taking the ostream to log to.
|
|
Adds a log type to be recognised by this logger.
|
|
Gets the name associated with the given log type.
|
|
Gets the log type associated with the given name.
|
|
Log all members of the given container (if the currently set log type is valid) or discard them (if the currently set log type is invalid).
|
|
Sets the log state of the logger (valid if the log type is recognised, invalid otherwise) and returns the logger. This method should be called before every logging.
|
|
Log an ostream manipulator to the specified ostream (if the currently set log type is valid) or discard the element (if the currently set log type is invalid).
|
|
Log an element to the specified ostream (if the currently set log type is valid) or discard the element (if the currently set log type is invalid).
|
|
Write a text representation of this logger to an ostream.
|
|
The set of log types recognised by this logger. |
|
Is the logger valid? (Is a recognised log type set?) |
|
The ostream associated with this logger. |