LogChannel
LogChannel
#include <icy/logger.h>class LogChannelDefined in src/base/include/icy/logger.h:346
Subclassed by:
ConsoleChannel,FileChannel,RotatingFileChannel
Named log output channel with configurable severity level and formatting.
List of all members
| Name | Kind | Owner |
|---|---|---|
LogChannel | function | Declared here |
~LogChannel | function | Declared here |
write | function | Declared here |
write | function | Declared here |
format | function | Declared here |
name | function | Declared here |
level | function | Declared here |
timeFormat | function | Declared here |
setLevel | function | Declared here |
setTimeFormat | function | Declared here |
setFilter | function | Declared here |
_name | variable | Declared here |
_level | variable | Declared here |
_timeFormat | variable | Declared here |
_filter | variable | Declared here |
Public Methods
| Return | Name | Description |
|---|---|---|
LogChannel | ||
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
LogChannel(std::string name, Level level = Level::Debug, std::string timeFormat = "%H:%M:%S")Defined in src/base/include/icy/logger.h:352
Parameters
nameUnique channel name.levelMinimum severity level; messages below this level are dropped.timeFormatstrftime-compatible format string for timestamps.
write
virtual
virtual void write(const LogStream & stream)Defined in src/base/include/icy/logger.h:358
Writes a log stream entry to this channel.
Parameters
streamThe log stream to write.
Reimplemented by
write
virtual
virtual void write(std::string message, Level level = Level::Debug, std::string realm = "")Defined in src/base/include/icy/logger.h:364
Writes a plain message to this channel.
Parameters
messageLog message text.levelSeverity level for the message.realmOptional source realm (e.g. file or class name).
format
virtual
virtual void format(const LogStream & stream, std::ostream & ost)Defined in src/base/include/icy/logger.h:370
Formats a log stream entry into the given output stream.
Parameters
streamThe log stream to format.ostThe output stream to write the formatted message into.
name
const inline
inline std::string name() constDefined in src/base/include/icy/logger.h:373
Returns the channel name.
level
const inline
inline Level level() constDefined in src/base/include/icy/logger.h:376
Returns the minimum severity level.
timeFormat
const inline
inline std::string timeFormat() constDefined in src/base/include/icy/logger.h:379
Returns the timestamp format string.
setLevel
inline
inline void setLevel(Level level)Defined in src/base/include/icy/logger.h:383
Sets the minimum severity level.
Parameters
levelMessages below this level are dropped.
setTimeFormat
inline
inline void setTimeFormat(std::string format)Defined in src/base/include/icy/logger.h:387
Sets the timestamp format string.
Parameters
formatstrftime-compatible format string.
setFilter
inline
inline void setFilter(std::string filter)Defined in src/base/include/icy/logger.h:391
Sets a realm filter; only messages whose realm matches are written.
Parameters
filterRealm substring or pattern to match against.
Protected Attributes
| Return | Name | Description |
|---|---|---|
std::string | _name | |
Level | _level | |
std::string | _timeFormat | |
std::string | _filter |
_name
std::string _nameDefined in src/base/include/icy/logger.h:394
_level
Level _levelDefined in src/base/include/icy/logger.h:395
_timeFormat
std::string _timeFormatDefined in src/base/include/icy/logger.h:396
_filter
std::string _filter