The logging mechanism.
More...
|
void | initialize (bool info_to_stdout=false, bool warning_to_stdcout=true, bool error_to_stdcout=true, bool verbose_to_stdcout=false, const std::string &log_file="default", int verbosity_threshold=9) |
| Initializes the logging module.
|
|
bool | is_initialized () |
| Returns whether the logging has been initialized.
|
|
std::string | log_file () |
| Returns the full path of the log file (empty if no log file has been created).
|
|
◆ initialize()
void initialize |
( |
bool | info_to_stdout = false, |
|
|
bool | warning_to_stdcout = true, |
|
|
bool | error_to_stdcout = true, |
|
|
bool | verbose_to_stdcout = false, |
|
|
const std::string & | log_file = "default", |
|
|
int | verbosity_threshold = 9 ) |
Initializes the logging module.
- Parameters
-
info_to_stdout | true to log messages at a the INFO level to standard output. |
warning_to_stdcout | true to log messages at a the WARNING level to standard output. |
error_to_stdcout | true to log messages at a the ERROR (including FATAL ) level to standard output. |
verbose_to_stdcout | true to log messages at a the ERROR (including FATAL ) level to standard output. |
log_file | A string specifying the name of log file. Three different values are accepted:
- "": an empty string, indicating that no log file will be created.
- "default": create a log file with a title in the form "AppName.log" next to the executable file.
- any non-empty string: (if it is a valid path) a log file with the same name will be created and log messages will be written to this file.
|
verbosity_threshold | A VLOG(level) with level <= verbosity_threshold will be written into the log file (if specified). Value must be in the range [0, 9]. Default is 0. |
- Note
- This initialization is optional. If not called, log messages will be written to standard output only.
- Examples
- Tutorial_203_Viewer_wxWidgets/main.cpp.