|
0.12.0
|
|
Freundlich's C++ toolkit |
The main logger class.
This class represents a logger object, encapsulating a level stream for every log level, a formatter for the logger itself and which log levels are activated. You should create one logger object for each subsystem you wish to enable or disable logging for.
Public Member Functions | |
| object (fcppt::log::parameters::object const ¶meters) | |
| Constructs a logger object. | |
| ~object () | |
| Destroys a logger object. | |
| void | log (fcppt::log::level::type level, fcppt::log::detail::temporary_output const &output) |
| Logs a message. | |
| fcppt::log::level_stream & | level_sink (fcppt::log::level::type level) |
| The level stream corresponding to a log level. | |
| fcppt::log::level_stream const & | level_sink (fcppt::log::level::type level) const |
| The level stream corresponding to a log level. | |
| void | activate (fcppt::log::level::type level) |
| Activates a log level. | |
| void | deactivate (fcppt::log::level::type level) |
| Deactivates a log level. | |
| bool | activated (fcppt::log::level::type level) const |
| Returns if a level is activated. | |
| bool | enabled_and_activated (fcppt::log::level::type level) const |
| Returns if a level is activated and the logger is enabled. | |
| void | enable (bool enabled) |
| Sets the logger's enabled state. | |
| bool | enabled () const |
| Returns if the logger is enabled. | |
| fcppt::log::format::function const & | formatter () const |
| Returns the associated formatter. | |
| fcppt::log::level_stream_array const & | level_streams () const |
| Returns the associated level streams. | |
| fcppt::log::enabled_level_array const & | enabled_levels () const |
| Returns which levels are enabled. | |
| fcppt::log::optional_location const | location () const |
| Returns the location if any. | |
|
explicit |
Constructs a logger object.
Constructs a logger object given the parameters parameters
| fcppt::log::object::~object | ( | ) |
Destroys a logger object.
It is important the logger object is destroyed before its context is destroyed, if it has one.
| void fcppt::log::object::activate | ( | fcppt::log::level::type | level | ) |
Activates a log level.
Activates the log level given by level
| level | The log level to activate |
| bool fcppt::log::object::activated | ( | fcppt::log::level::type | level | ) | const |
Returns if a level is activated.
Returns if level is activated.
| level | The log level to query the activated state for |
| void fcppt::log::object::deactivate | ( | fcppt::log::level::type | level | ) |
Deactivates a log level.
Deactivates the log level given by level
| level | The log level to deactivate |
| void fcppt::log::object::enable | ( | bool | enabled | ) |
Sets the logger's enabled state.
Sets the logger's enabled state to enabled
| enabled | The new enabled state |
| bool fcppt::log::object::enabled | ( | ) | const |
Returns if the logger is enabled.
| bool fcppt::log::object::enabled_and_activated | ( | fcppt::log::level::type | level | ) | const |
Returns if a level is activated and the logger is enabled.
Returns if level is activated and the logger is enabled. Equivalent to activated(level) && enabled().
| level | The log level to query the activated state for |
| fcppt::log::enabled_level_array const& fcppt::log::object::enabled_levels | ( | ) | const |
Returns which levels are enabled.
| fcppt::log::format::function const& fcppt::log::object::formatter | ( | ) | const |
Returns the associated formatter.
| fcppt::log::level_stream& fcppt::log::object::level_sink | ( | fcppt::log::level::type | level | ) |
The level stream corresponding to a log level.
Returns the level stream corresponding to level.
| level | The log level to get the level stream for |
| fcppt::log::level_stream const& fcppt::log::object::level_sink | ( | fcppt::log::level::type | level | ) | const |
The level stream corresponding to a log level.
Returns the level stream corresponding to level.
| level | The log level to get the level stream for |
| fcppt::log::level_stream_array const& fcppt::log::object::level_streams | ( | ) | const |
Returns the associated level streams.
| fcppt::log::optional_location const fcppt::log::object::location | ( | ) | const |
Returns the location if any.
fcppt::log::optional_location() | void fcppt::log::object::log | ( | fcppt::log::level::type | level, |
| fcppt::log::detail::temporary_output const & | output | ||
| ) |
Logs a message.
Logs a message given by output to level level. If enabled_and_activated(level) is false, nothing will be logged. An output can be constructed from fcppt::log::_.
| level | The log level to log to |
| output | The output to log |
1.8.2