#include <icy/logger.h>Subclassed by:
ConsoleChannel,FileChannel,RotatingFileChannel
Named log output channel with configurable severity level and formatting.
| Return | Name | Description |
|---|---|---|
LogChannel | #### Parameters | |
void | write virtual | Writes a log stream entry to this channel. |
void | write virtual | Writes a plain message to this channel. |
void | format virtual | Formats a log stream entry into the given output stream. |
std::string | name const inline | Returns the channel name. |
Level | level const inline | Returns the minimum severity level. |
std::string | timeFormat const inline | Returns the timestamp format string. |
void | setLevel inline | Sets the minimum severity level. |
void | setTimeFormat inline | Sets the timestamp format string. |
void | setFilter inline | Sets a realm filter; only messages whose realm matches are written. |
LogChannel(std::string name, Level level, std::string timeFormat)name Unique channel name.
level Minimum severity level; messages below this level are dropped.
timeFormat strftime-compatible format string for timestamps.
virtual
virtual void write(const LogStream & stream)Writes a log stream entry to this channel.
stream The log stream to write.virtual
virtual void write(std::string message, Level level, std::string realm)Writes a plain message to this channel.
message Log message text.
level Severity level for the message.
realm Optional source realm (e.g. file or class name).
virtual
virtual void format(const LogStream & stream, std::ostream & ost)Formats a log stream entry into the given output stream.
stream The log stream to format.
ost The output stream to write the formatted message into.
const inline
inline std::string name() constReturns the channel name.
const inline
inline Level level() constReturns the minimum severity level.
const inline
inline std::string timeFormat() constReturns the timestamp format string.
inline
inline void setLevel(Level level)Sets the minimum severity level.
level Messages below this level are dropped.inline
inline void setTimeFormat(std::string format)Sets the timestamp format string.
format strftime-compatible format string.inline
inline void setFilter(std::string filter)Sets a realm filter; only messages whose realm matches are written.
filter Realm substring or pattern to match against.| Return | Name | Description |
|---|---|---|
std::string | _name | |
Level | _level | |
std::string | _timeFormat | |
std::string | _filter |
std::string _nameLevel _levelstd::string _timeFormatstd::string _filter