FileChannel
FileChannel
#include <icy/logger.h>class FileChannelDefined in src/base/include/icy/logger.h:437
Inherits:
LogChannel
Log channel that writes formatted messages to a file.
List of all members
| Name | Kind | Owner |
|---|---|---|
FileChannel | function | Declared here |
~FileChannel | function | Declared here |
write | function | Declared here |
setPath | function | Declared here |
path | function | Declared here |
_fstream | variable | Declared here |
_path | variable | Declared here |
open | function | Declared here |
close | function | Declared here |
LogChannel | function | Inherited from LogChannel |
~LogChannel | function | Inherited from LogChannel |
write | function | Inherited from LogChannel |
write | function | Inherited from LogChannel |
format | function | Inherited from LogChannel |
name | function | Inherited from LogChannel |
level | function | Inherited from LogChannel |
timeFormat | function | Inherited from LogChannel |
setLevel | function | Inherited from LogChannel |
setTimeFormat | function | Inherited from LogChannel |
setFilter | function | Inherited from LogChannel |
_name | variable | Inherited from LogChannel |
_level | variable | Inherited from LogChannel |
_timeFormat | variable | Inherited from LogChannel |
_filter | variable | Inherited from LogChannel |
Inherited from LogChannel
| Kind | Name | Description |
|---|---|---|
function | LogChannel | |
function | ~LogChannel virtual | Defaulted destructor. |
function | write virtual | Writes a log stream entry to this channel. |
function | write virtual | Writes a plain message to this channel. |
function | format virtual | Formats a log stream entry into the given output stream. |
function | name const inline | Returns the channel name. |
function | level const inline | Returns the minimum severity level. |
function | timeFormat const inline | Returns the timestamp format string. |
function | setLevel inline | Sets the minimum severity level. |
function | setTimeFormat inline | Sets the timestamp format string. |
function | setFilter inline | Sets a realm filter; only messages whose realm matches are written. |
variable | _name | |
variable | _level | |
variable | _timeFormat | |
variable | _filter |
Public Methods
| Return | Name | Description |
|---|---|---|
FileChannel | ||
void | write virtual override | Formats and writes the log stream entry to the file. Opens the file on first write if not already open. |
void | setPath | Sets the file path and reopens the file stream. |
std::string | path const | Returns the current log file path. |
FileChannel
FileChannel(std::string name, std::string path, Level level = Level::Debug, std::string timeFormat = "%H:%M:%S")Defined in src/base/include/icy/logger.h:444
Parameters
nameUnique channel name.pathPath to the output log file. Directories are created if needed.levelMinimum severity level; messages below this level are dropped.timeFormatstrftime-compatible format string for timestamps.
write
virtual override
virtual void write(const LogStream & stream) overrideDefined in src/base/include/icy/logger.h:452
Formats and writes the log stream entry to the file. Opens the file on first write if not already open.
Parameters
streamThe log stream to write.
Reimplements
setPath
void setPath(const std::string & path)Defined in src/base/include/icy/logger.h:456
Sets the file path and reopens the file stream.
Parameters
pathPath to the new log file.
path
const
std::string path() constDefined in src/base/include/icy/logger.h:460
Returns the current log file path.
Returns
Absolute or relative path to the log file.
Protected Attributes
_fstream
std::ofstream _fstreamDefined in src/base/include/icy/logger.h:467
_path
std::string _pathDefined in src/base/include/icy/logger.h:468
Protected Methods
open
virtual
virtual void open()Defined in src/base/include/icy/logger.h:463
close
virtual
virtual void close()