4.4.0
|
|
Freundlich's C++ toolkit |
The stream for a logger level.
Every logger object has a level stream for each logging levels. This class dictates which sink and formatters should be used for a given level. Objects of this class can be shared between several logger objects.
Public Member Functions | |
FCPPT_LOG_DETAIL_SYMBOL | level_stream (fcppt::io::ostream &stream, fcppt::log::format::optional_function &&formatter) |
Constructs a level stream with a sink and a formatter. | |
FCPPT_LOG_DETAIL_SYMBOL void | log (fcppt::log::detail::temporary_output const &output, fcppt::log::format::optional_function const &additional_formatter) const |
Logs to this level stream. | |
FCPPT_LOG_DETAIL_SYMBOL void | sink (fcppt::io::ostream &stream) |
Sets a new sink. | |
FCPPT_LOG_DETAIL_SYMBOL fcppt::io::ostream & | get () |
Gets the current stream. | |
FCPPT_LOG_DETAIL_SYMBOL fcppt::log::format::optional_function const & | formatter () const |
Returns the associated formatter. | |
FCPPT_LOG_DETAIL_SYMBOL fcppt::log::level_stream::level_stream | ( | fcppt::io::ostream & | stream, |
fcppt::log::format::optional_function && | formatter | ||
) |
Constructs a level stream with a sink and a formatter.
Constructs a level stream with sink stream and formatter formatter
stream | The stream to log to |
formatter | The formatting to use for this level |
FCPPT_LOG_DETAIL_SYMBOL fcppt::log::format::optional_function const & fcppt::log::level_stream::formatter | ( | ) | const |
Returns the associated formatter.
FCPPT_LOG_DETAIL_SYMBOL fcppt::io::ostream & fcppt::log::level_stream::get | ( | ) |
Gets the current stream.
FCPPT_LOG_DETAIL_SYMBOL void fcppt::log::level_stream::log | ( | fcppt::log::detail::temporary_output const & | output, |
fcppt::log::format::optional_function const & | additional_formatter | ||
) | const |
Logs to this level stream.
Logs the output represented by output, using additional formatting provided by additional_formatter. fcppt::log::detail::temporary_output can be constructed by fcppt::log::out.
output | The output to log |
additional_formatter | Additional formatting to be used. This formatter is used first, and is usually provided by the logger object itself. |
FCPPT_LOG_DETAIL_SYMBOL void fcppt::log::level_stream::sink | ( | fcppt::io::ostream & | stream | ) |
Sets a new sink.
stream | The stream to use |