Honeycomb
0.1
Component-Model Framework
|
Logger. More...
#include <Log.h>
Classes | |
struct | RecordStream |
Builds a record. More... | |
Public Types | |
typedef DepGraph< const log::Level > | LevelGraph |
typedef unordered_map< Id, log::Sink::Ptr > | SinkMap |
Public Member Functions | |
Log () | |
Create logger with default levels and a standard streams sinks ("stdout" and "stderr") More... | |
void | addLevel (const log::Level &level) |
Add a severity level to categorize records. More... | |
void | removeLevel (const log::Level &level) |
const LevelGraph & | levels () const |
void | addSink (const Id &name, const log::Sink::Ptr &sink) |
Add a sink to receive records. More... | |
void | removeSink (const Id &name) |
const SinkMap & | sinks () const |
void | filter (const Id &sink, const vector< const log::Level * > &includes, bool includeDeps=true, const vector< const log::Level * > &excludes={}, bool excludeDeps=true) |
Add a record filter to a sink. More... | |
void | clearFilter (const Id &sink) |
RecordStream | operator<< (const log::Level &level) |
Push a record with level to all sinks. More... | |
SpinLock::Scoped | lock () |
Acquire lock to synchronize output to sinks, other loggers should call this before outputting to the same sinks. More... | |
Static Public Member Functions | |
static | mt_global (Log, inst,) |
Get singleton. More... | |
Logger.
typedef DepGraph<const log::Level> honey::Log::LevelGraph |
typedef unordered_map<Id, log::Sink::Ptr> honey::Log::SinkMap |
honey::Log::Log | ( | ) |
Create logger with default levels and a standard streams sinks ("stdout" and "stderr")
void honey::Log::addLevel | ( | const log::Level & | level | ) |
Add a severity level to categorize records.
void honey::Log::addSink | ( | const Id & | name, |
const log::Sink::Ptr & | sink | ||
) |
Add a sink to receive records.
void honey::Log::clearFilter | ( | const Id & | sink | ) |
void honey::Log::filter | ( | const Id & | sink, |
const vector< const log::Level * > & | includes, | ||
bool | includeDeps = true , |
||
const vector< const log::Level * > & | excludes = {} , |
||
bool | excludeDeps = true |
||
) |
Add a record filter to a sink.
sink | sink to filter |
includes | levels to push to sink |
includeDeps | also include any levels that the includes depend on |
excludes | levels to not push to sink |
excludeDeps | also exclude any levels that the excludes depend on |
|
inline |
|
inline |
Acquire lock to synchronize output to sinks, other loggers should call this before outputting to the same sinks.
|
static |
Get singleton.
|
inline |
Push a record with level to all sinks.
void honey::Log::removeLevel | ( | const log::Level & | level | ) |
void honey::Log::removeSink | ( | const Id & | name | ) |
|
inline |