LogChannel
#include <icy/logger.h>
class LogChannelDefined in src/base/include/icy/logger.h:384
- Subclassed by
ConsoleChannel,FileChannel,RotatingFileChannel
Public Methods
| Return | Name | Description |
|---|---|---|
LogChannel | ||
~LogChannel virtual | Defaulted destructor. | |
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:390
Parameters
| Parameter | Type | Description |
|---|---|---|
name | std::string | Unique channel name. |
level | Level | Minimum severity level; messages below this level are dropped. |
timeFormat | std::string | strftime-compatible format string for timestamps. |
~LogChannel
virtual
virtual ~LogChannel() = defaultDefined in src/base/include/icy/logger.h:392
Defaulted destructor.
write
virtual
virtual void write(const LogStream & stream)Defined in src/base/include/icy/logger.h:396
Writes a log stream entry to this channel.
Reimplemented by
Parameters
| Parameter | Type | Description |
|---|---|---|
stream | const LogStream & | The log stream to write. |
write
virtual
virtual void write(std::string message, Level level = Level::Debug, std::string realm = "")Defined in src/base/include/icy/logger.h:402
Writes a plain message to this channel.
Parameters
| Parameter | Type | Description |
|---|---|---|
message | std::string | Log message text. |
level | Level | Severity level for the message. |
realm | std::string | Optional 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:408
Formats a log stream entry into the given output stream.
Parameters
| Parameter | Type | Description |
|---|---|---|
stream | const LogStream & | The log stream to format. |
ost | std::ostream & | The output stream to write the formatted message into. |
name
const inline
inline std::string name() constDefined in src/base/include/icy/logger.h:411
Returns the channel name.
level
const inline
inline Level level() constDefined in src/base/include/icy/logger.h:414
Returns the minimum severity level.
timeFormat
const inline
inline std::string timeFormat() constDefined in src/base/include/icy/logger.h:417
Returns the timestamp format string.
setLevel
inline
inline void setLevel(Level level)Defined in src/base/include/icy/logger.h:421
Sets the minimum severity level.
Parameters
| Parameter | Type | Description |
|---|---|---|
level | Level | Messages below this level are dropped. |
setTimeFormat
inline
inline void setTimeFormat(std::string format)Defined in src/base/include/icy/logger.h:429
Sets the timestamp format string.
Parameters
| Parameter | Type | Description |
|---|---|---|
format | std::string | strftime-compatible format string. |
setFilter
inline
inline void setFilter(std::string filter)Defined in src/base/include/icy/logger.h:433
Sets a realm filter; only messages whose realm matches are written.
Parameters
| Parameter | Type | Description |
|---|---|---|
filter | std::string | Realm 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:436
_level
Level _levelType: Level
Defined in src/base/include/icy/logger.h:437
_timeFormat
std::string _timeFormatDefined in src/base/include/icy/logger.h:438
_filter
std::string _filter