Basic log handler that writes to specified output streams.
More...
#include <handler.h>
|
| | BaseHandler (std::ostream &outStream, std::ostream &errStream, std::shared_ptr< AbstractFormatter > formatter, LogLevel minLevel=LogLevel::DEBUG, std::shared_ptr< const LogStyleMap > styles=nullptr) |
| | Construct a new Base Handler using the given out and error streams.
|
| |
| void | emit (const LogRecord &record) const override |
| | Emit a log record, using the handlers formatter and specified output.
|
| |
| void | setStylingEnabled (bool enabled) |
| | Enable or disable styling for log messages.
|
| |
| void | setStyleMap (std::shared_ptr< const LogStyleMap > styles) |
| | Attach a style map (for ANSI colors).
|
| |
|
|
std::ostream & | out |
| |
|
std::ostream & | err |
| |
Basic log handler that writes to specified output streams.
◆ BaseHandler()
| cli::logging::BaseHandler::BaseHandler |
( |
std::ostream & |
outStream, |
|
|
std::ostream & |
errStream, |
|
|
std::shared_ptr< AbstractFormatter > |
formatter, |
|
|
LogLevel |
minLevel = LogLevel::DEBUG, |
|
|
std::shared_ptr< const LogStyleMap > |
styles = nullptr |
|
) |
| |
|
inline |
Construct a new Base Handler using the given out and error streams.
- Parameters
-
| outStream | The output stream for log messages |
| errStream | The error stream for log messages |
| formatter | The formatter to use for log messages |
| minLevel | The minimum log level for this handler |
| styles | The styles to use for log messages |
◆ emit()
| inline_t void cli::logging::BaseHandler::emit |
( |
const LogRecord & |
record | ) |
const |
|
overridevirtual |
Emit a log record, using the handlers formatter and specified output.
- Parameters
-
| record | The log record to emit. |
Implements cli::logging::AbstractHandler.
◆ setStyleMap()
| inline_t void cli::logging::BaseHandler::setStyleMap |
( |
std::shared_ptr< const LogStyleMap > |
styles | ) |
|
Attach a style map (for ANSI colors).
- Parameters
-
| styles | The styles to use for log messages. |
◆ setStylingEnabled()
| void cli::logging::BaseHandler::setStylingEnabled |
( |
bool |
enabled | ) |
|
|
inline |
Enable or disable styling for log messages.
- Parameters
-
| enabled | Whether styling should be enabled. |
The documentation for this class was generated from the following files:
- src/chaincli/logging/handler.h
- src/chaincli/logging/handler.cpp