Class of loggers.
More...
#include <num_collect/logging/logger.h>
Class of loggers.
- Thread Safety
- All
const
member functions (member functions except for initialize_child_algorithm_logger function, constructors, destructor, and assignment operators) are thread safe even for the same object.
For logging, following macros can be used:
Definition at line 145 of file logger.h.
◆ logger() [1/4]
num_collect::logging::logger::logger |
( |
| ) |
|
|
inline |
◆ logger() [2/4]
Constructor.
- Parameters
-
Definition at line 157 of file logger.h.
◆ logger() [3/4]
Constructor.
- Parameters
-
[in] | tag | Tag. |
[in] | config | Configuration. |
Definition at line 165 of file logger.h.
◆ logger() [4/4]
Constructor.
- Parameters
-
[in] | tag | Tag. |
[in] | config | Configuration. |
Definition at line 174 of file logger.h.
◆ config()
auto num_collect::logging::logger::config |
( |
| ) |
const -> const log_tag_config& |
|
inlinenodiscardnoexcept |
Get the configuration.
- Returns
- Configuration.
Definition at line 194 of file logger.h.
◆ critical()
Write a critical log.
- Parameters
-
[in] | source | Information of the source code. |
- Returns
- Proxy object to write log.
- Note
- Argument source should be left to be the default value if you want to write logs with the current position.
Definition at line 386 of file logger.h.
◆ debug()
Write a debug log.
- Parameters
-
[in] | source | Information of the source code. |
- Returns
- Proxy object to write log.
- Note
- Argument source should be left to be the default value if you want to write logs with the current position.
Definition at line 278 of file logger.h.
◆ error()
Write a error log.
- Parameters
-
[in] | source | Information of the source code. |
- Returns
- Proxy object to write log.
- Note
- Argument source should be left to be the default value if you want to write logs with the current position.
Definition at line 371 of file logger.h.
◆ info()
Write a information log.
- Parameters
-
[in] | source | Information of the source code. |
- Returns
- Proxy object to write log.
- Note
- Argument source should be left to be the default value if you want to write logs with the current position.
Definition at line 341 of file logger.h.
◆ initialize_child_algorithm_logger()
void num_collect::logging::logger::initialize_child_algorithm_logger |
( |
logger & | child | ) |
|
|
inlinenoexcept |
Initialize a logger as the logger of the algorithm called from the algorithm of this logger.
- Parameters
-
[in] | child | Logger of the algorithm called from the algorithm of this logger. |
Definition at line 212 of file logger.h.
◆ iteration()
Write a iteration log.
- Parameters
-
[in] | source | Information of the source code. |
- Returns
- Proxy object to write log.
- Note
- Argument source should be left to be the default value if you want to write logs with the current position.
-
This class don't take configurations of periods into account.
Definition at line 294 of file logger.h.
◆ iteration_label()
Write a label of iteration logs.
- Parameters
-
[in] | source | Information of the source code. |
- Returns
- Proxy object to write log.
- Note
- Argument source should be left to be the default value if you want to write logs with the current position.
-
This class don't take configurations of periods into account.
Definition at line 310 of file logger.h.
◆ log()
Write a log.
- Parameters
-
[in] | level | Log level. |
[in] | source | Information of the source code. |
- Returns
- Proxy object to write log.
- Note
- Argument source should be left to be the default value if you want to write logs with the current position.
Definition at line 247 of file logger.h.
◆ log_without_condition_check() [1/2]
template<typename... Args>
requires (sizeof...(Args) > 0)
void num_collect::logging::logger::log_without_condition_check |
( |
util::source_info_view | source, |
|
|
log_level | level, |
|
|
fmt::format_string< Args... > | format, |
|
|
Args &&... | args ) const |
|
inline |
Write a log without check of the condition to write logs.
- Warning
- This function should be used with should_log() function.
- Template Parameters
-
- Parameters
-
[in] | source | Information of the source code. |
[in] | level | Log level. |
[in] | format | Format string. |
[in] | args | Arguments for the format string. |
Definition at line 420 of file logger.h.
◆ log_without_condition_check() [2/2]
Write a log without check of the condition to write logs.
- Warning
- This function should be used with should_log() function.
- Parameters
-
[in] | source | Information of the source code. |
[in] | level | Log level. |
[in] | body | Body. |
Definition at line 401 of file logger.h.
◆ set_iterative()
void num_collect::logging::logger::set_iterative |
( |
| ) |
const |
|
inlinenoexcept |
Set this node to an iterative algorithm.
Definition at line 201 of file logger.h.
◆ should_log()
auto num_collect::logging::logger::should_log |
( |
log_level | level | ) |
const -> bool |
|
inlinenodiscardnoexcept |
Check whether to write logs with a log level.
- Parameters
-
- Return values
-
true | Should write logs. |
false | Should not write logs. |
Definition at line 224 of file logger.h.
◆ summary()
Write a summary log.
- Parameters
-
[in] | source | Information of the source code. |
- Returns
- Proxy object to write log.
- Note
- Argument source should be left to be the default value if you want to write logs with the current position.
-
This class don't take configurations of periods into account.
Definition at line 326 of file logger.h.
◆ tag()
auto num_collect::logging::logger::tag |
( |
| ) |
const -> const log_tag& |
|
inlinenodiscardnoexcept |
Get the log tag.
- Returns
- Log tag.
Definition at line 187 of file logger.h.
◆ trace()
Write a trace log.
- Parameters
-
[in] | source | Information of the source code. |
- Returns
- Proxy object to write log.
- Note
- Argument source should be left to be the default value if you want to write logs with the current position.
Definition at line 263 of file logger.h.
◆ warning()
Write a warning log.
- Parameters
-
[in] | source | Information of the source code. |
- Returns
- Proxy object to write log.
- Note
- Argument source should be left to be the default value if you want to write logs with the current position.
Definition at line 356 of file logger.h.
◆ always_output_log_level_
log_level num_collect::logging::logger::always_output_log_level_ |
|
private |
Minimum log level to output always.
Definition at line 438 of file logger.h.
◆ config_
Configuration.
Definition at line 435 of file logger.h.
◆ iteration_layer_handler_
Handler of layers of iterations.
Definition at line 444 of file logger.h.
◆ lowest_output_log_level_
log_level num_collect::logging::logger::lowest_output_log_level_ |
|
private |
Lowest log level to output.
Definition at line 441 of file logger.h.
◆ tag_
log_tag num_collect::logging::logger::tag_ |
|
private |
The documentation for this class was generated from the following file: