4.6.0
Freundlich's C++ toolkit
Loading...
Searching...
No Matches
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::name const &)
 Constructs a root logger object.
 
FCPPT_LOG_DETAIL_SYMBOL object (fcppt::log::object const &parent, fcppt::log::name const &)
 Constructs a child logger object.
 
FCPPT_LOG_DETAIL_SYMBOL object (fcppt::log::context_reference, fcppt::log::location const &, fcppt::log::name const &)
 Constructs a log at a specific location.
 
FCPPT_LOG_DETAIL_SYMBOL ~object ()
 
FCPPT_LOG_DETAIL_SYMBOL void log (fcppt::log::level level, fcppt::log::detail::temporary_output const &output) const
 Logs a message.
 
FCPPT_LOG_DETAIL_SYMBOL fcppt::log::level_stream const & level_sink (fcppt::log::level level) const
 The level stream corresponding to a log level.
 
FCPPT_LOG_DETAIL_SYMBOL bool enabled (fcppt::log::level level) const
 Returns if a level is activated.
 
FCPPT_LOG_DETAIL_SYMBOL fcppt::log::level_stream_array const & level_streams () const
 Returns the associated level streams.
 
FCPPT_LOG_DETAIL_SYMBOL fcppt::log::optional_level level () const
 Returns the current log level.
 

Constructor & Destructor Documentation

◆ object() [1/3]

FCPPT_LOG_DETAIL_SYMBOL fcppt::log::object::object ( fcppt::log::context_reference ,
fcppt::log::name const &  )

Constructs a root logger object.

◆ object() [2/3]

FCPPT_LOG_DETAIL_SYMBOL fcppt::log::object::object ( fcppt::log::object const & parent,
fcppt::log::name 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::name 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
nodiscard

Returns if a level is activated.

Parameters
levelThe log level to query the activated state for

◆ level()

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

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
nodiscard

The level stream corresponding to a log level.

Parameters
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
nodiscard

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 ) const

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 .

Parameters
levelThe log level to log to
outputThe output to log
Note
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.