Honeycomb  0.1
Component-Model Framework
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
honey::Log Class Reference

Logger. More...

#include <Log.h>

Classes

struct  RecordStream
 Builds a record. More...
 

Public Types

typedef DepGraph< const log::LevelLevelGraph
 
typedef unordered_map< Id, log::Sink::PtrSinkMap
 

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 LevelGraphlevels () const
 
void addSink (const Id &name, const log::Sink::Ptr &sink)
 Add a sink to receive records. More...
 
void removeSink (const Id &name)
 
const SinkMapsinks () 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...
 

Detailed Description

Logger.

Member Typedef Documentation

typedef unordered_map<Id, log::Sink::Ptr> honey::Log::SinkMap

Constructor & Destructor Documentation

honey::Log::Log ( )

Create logger with default levels and a standard streams sinks ("stdout" and "stderr")

Member Function Documentation

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.

Parameters
sinksink to filter
includeslevels to push to sink
includeDepsalso include any levels that the includes depend on
excludeslevels to not push to sink
excludeDepsalso exclude any levels that the excludes depend on
const LevelGraph& honey::Log::levels ( ) const
inline
SpinLock::Scoped honey::Log::lock ( )
inline

Acquire lock to synchronize output to sinks, other loggers should call this before outputting to the same sinks.

static honey::Log::mt_global ( Log  ,
inst   
)
static

Get singleton.

RecordStream honey::Log::operator<< ( const log::Level level)
inline

Push a record with level to all sinks.

void honey::Log::removeLevel ( const log::Level level)
void honey::Log::removeSink ( const Id name)
const SinkMap& honey::Log::sinks ( ) const
inline

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