Logging Utilities

Summary
Enumeration defining severity of an error.
Base class for all LogSinks to be used with Log, derived classes must define message(LogLevel level, std::string string).
LogSink constructor, requires a name.
Virtual destructor, available to make inheritance safe.
Pure virtual function which derived classes must define to write the message.
Gets name of the sink.
Pointer to a log sink, used since LogSink is abstract and will always be accessed via a pointer.
LogSink to be used with Log for simple console output.
LogSink to be used with Log for simple text file output.
LogSink to be used with Log for simple HTML output.

LogLevel

Enumeration defining severity of an error.

Values

LOG_NOTEA note, highest priority so that they are always printed, not used for errors, only for temporary notes.
LOG_VERBOSEVerbose warning, lowest priority.
LOG_WARNINGA warning, used for non critical failures.
LOG_ERRORNormal error, used for potential serious failures.
LOG_CRITICALCritical error, used for failures which are threats to stability.

LogSink

Base class for all LogSinks to be used with Log, derived classes must define message(LogLevel level, std::string string).  A LogSink recieves any messages passed to the log it’s registered with.

Children

ConsoleSink TextSink HTMLSink

Summary
LogSink constructor, requires a name.
Virtual destructor, available to make inheritance safe.
Pure virtual function which derived classes must define to write the message.
Gets name of the sink.
Pointer to a log sink, used since LogSink is abstract and will always be accessed via a pointer.

(Con/ De)structors

LogSink

LogSink(const std::string &name)

LogSink constructor, requires a name.

Parameters

name_Name of LogSink, every LogSink should have a unique name.

~LogSink

virtual ~LogSink()

Virtual destructor, available to make inheritance safe.

Functions

writeMessage

virtual void writeMessage(LogLevel level,
const std::string &msg)=0

Pure virtual function which derived classes must define to write the message.

Parameters

levelLogLevel of log event.
msgString describing log message.

Accessors

getName

std::string getName() const

Gets name of the sink.

Returns

Name of the LogSink.

LogSinkPtr

Pointer to a log sink, used since LogSink is abstract and will always be accessed via a pointer.

ConsoleSink

LogSink to be used with Log for simple console output.

See Also

TextSink, HTMLSink

Parent

LogSink

TextSink

LogSink to be used with Log for simple text file output.

See Also

ConsoleSink, HTMLSink

Parent

LogSink

HTMLSink

LogSink to be used with Log for simple HTML output.

See Also

TextSink, ConsoleSink

Parent

LogSink

Log class for photon, Log passes all messages to any attached LogSinks, which can then take care of any output which is desired.
LogSink(const std::string &name)
LogSink constructor, requires a name.
virtual ~LogSink()
Virtual destructor, available to make inheritance safe.
virtual void writeMessage(LogLevel level,
const std::string &msg)=0
Pure virtual function which derived classes must define to write the message.
std::string getName() const
Gets name of the sink.
Base class for all LogSinks to be used with Log, derived classes must define message(LogLevel level, std::string string).
LogSink to be used with Log for simple console output.
LogSink to be used with Log for simple text file output.
LogSink to be used with Log for simple HTML output.
Enumeration defining severity of an error.