3.0.0
Freundlich's C++ toolkit
Public Member Functions
fcppt::log::level_stream Class Reference

Detailed Description

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 const &formatter)
 Constructs a level stream with a sink and a formatter. More...
 
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. More...
 
FCPPT_LOG_DETAIL_SYMBOL void sink (fcppt::io::ostream &stream)
 Sets a new sink. More...
 
FCPPT_LOG_DETAIL_SYMBOL fcppt::io::ostreamget ()
 Gets the current stream. More...
 
FCPPT_LOG_DETAIL_SYMBOL fcppt::log::format::optional_function const & formatter () const
 Returns the associated formatter. More...
 

Constructor & Destructor Documentation

◆ level_stream()

FCPPT_LOG_DETAIL_SYMBOL fcppt::log::level_stream::level_stream ( fcppt::io::ostream stream,
fcppt::log::format::optional_function const &  formatter 
)

Constructs a level stream with a sink and a formatter.

Constructs a level stream with sink stream and formatter formatter

Parameters
streamThe stream to log to
formatterThe formatting to use for this level

Member Function Documentation

◆ formatter()

FCPPT_LOG_DETAIL_SYMBOL fcppt::log::format::optional_function const& fcppt::log::level_stream::formatter ( ) const

Returns the associated formatter.

◆ get()

FCPPT_LOG_DETAIL_SYMBOL fcppt::io::ostream& fcppt::log::level_stream::get ( )

Gets the current stream.

◆ log()

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.

Parameters
outputThe output to log
additional_formatterAdditional formatting to be used. This formatter is used first, and is usually provided by the logger object itself.

◆ sink()

FCPPT_LOG_DETAIL_SYMBOL void fcppt::log::level_stream::sink ( fcppt::io::ostream stream)

Sets a new sink.

Parameters
streamThe stream to use