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

Detailed Description

The main log class.

Logging is done through objects of this class. In the constructor, it gets a log context and a log location, providing it with a log level and level streams.

Public Member Functions

FCPPT_LOG_DETAIL_SYMBOL object (fcppt::log::context_reference, fcppt::log::parameters const &)
 Constructs a root logger object. More...
FCPPT_LOG_DETAIL_SYMBOL object (fcppt::log::object const &parent, fcppt::log::parameters const &)
 Constructs a child logger object. More...
FCPPT_LOG_DETAIL_SYMBOL object (fcppt::log::context_reference, fcppt::log::location const &, fcppt::log::parameters const &)
 Constructs a log at a specific location. More...
FCPPT_LOG_DETAIL_SYMBOL void log (fcppt::log::level level, fcppt::log::detail::temporary_output const &output)
 Logs a message. More...
FCPPT_LOG_DETAIL_SYMBOL fcppt::log::level_stream const & level_sink (fcppt::log::level level) const
 The level stream corresponding to a log level. More...
FCPPT_LOG_DETAIL_SYMBOL bool enabled (fcppt::log::level level) const
 Returns if a level is activated. More...
FCPPT_LOG_DETAIL_SYMBOL fcppt::log::format::optional_function const & formatter () const
 Returns the associated formatter. More...
FCPPT_LOG_DETAIL_SYMBOL fcppt::log::level_stream_array const & level_streams () const
 Returns the associated level streams. More...
FCPPT_LOG_DETAIL_SYMBOL fcppt::log::optional_level level () const
 Returns the current log level. More...

Constructor & Destructor Documentation

◆ object() [1/3]

FCPPT_LOG_DETAIL_SYMBOL fcppt::log::object::object ( fcppt::log::context_reference  ,
fcppt::log::parameters const &   

Constructs a root logger object.

◆ object() [2/3]

FCPPT_LOG_DETAIL_SYMBOL fcppt::log::object::object ( fcppt::log::object const &  parent,
fcppt::log::parameters const &   

Constructs a child logger object.

◆ object() [3/3]

FCPPT_LOG_DETAIL_SYMBOL fcppt::log::object::object ( fcppt::log::context_reference  ,
fcppt::log::location const &  ,
fcppt::log::parameters const &   

Constructs a log at a specific location.

◆ ~object()

FCPPT_LOG_DETAIL_SYMBOL fcppt::log::object::~object ( )

Member Function Documentation

◆ enabled()

FCPPT_LOG_DETAIL_SYMBOL bool fcppt::log::object::enabled ( fcppt::log::level  level) const

Returns if a level is activated.

levelThe log level to query the activated state for

◆ formatter()

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

Returns the associated formatter.

◆ level()

FCPPT_LOG_DETAIL_SYMBOL fcppt::log::optional_level fcppt::log::object::level ( ) const

Returns the current log level.

◆ level_sink()

FCPPT_LOG_DETAIL_SYMBOL fcppt::log::level_stream const& fcppt::log::object::level_sink ( fcppt::log::level  level) const

The level stream corresponding to a log level.

levelThe log level to get the level stream for

◆ level_streams()

FCPPT_LOG_DETAIL_SYMBOL fcppt::log::level_stream_array const& fcppt::log::object::level_streams ( ) const

Returns the associated level streams.

◆ log()

FCPPT_LOG_DETAIL_SYMBOL void fcppt::log::object::log ( fcppt::log::level  level,
fcppt::log::detail::temporary_output const &  output 

Logs a message.

Logs a message given by output to level level. If enabled(level) is false, nothing will be logged. An output can be constructed from fcppt::log::out .

levelThe log level to log to
outputThe output to log
You are advised not to use this element function directly, because creating an output even if the log object will discard it can be significant overhead. Instead, use the macros FCPPT_LOG_DEBUG and so on directly.