Container for loggers, and global logging options (such as verbose vs. quiet output).
More...
#include <common/common.hh>
|
static void | Close () |
| Detach fhe file sink from the global logger. After this call, console logging will keep working but no file logging.
|
|
static std::string | Directory () |
| Get the full path of the directory where all the log files are stored.
|
|
static bool | Init (const std::string &_directory, const std::string &_filename) |
| Initialize the global logger.
|
|
static std::string | Prefix () |
| Get custom prefix. This is empty by default.
|
|
static Console & | Root () |
| Access the global gz console logger.
|
|
static void | SetPrefix (const std::string &_customPrefix) |
| Add a custom prefix in front of the default prefixes.
|
|
static void | SetVerbosity (const int _level) |
| Set verbosity, where 0: Critical messages, 1: Critical, error messages, 2: Critical, error and warning messages, 3: Critical, error, warning, and info messages, 4: Critical, error, warning, info, and debug messages. 5: Critical, error, warning, info, debug, and trace messages.
|
|
static int | Verbosity () |
| Get the verbose level.
|
|
Container for loggers, and global logging options (such as verbose vs. quiet output).
◆ Console()
Class constructor.
- Parameters
-
[in] | _loggerName | Logger name. |
◆ Close()
Detach fhe file sink from the global logger. After this call, console logging will keep working but no file logging.
◆ Directory()
Get the full path of the directory where all the log files are stored.
- Returns
- Full path of the directory.
◆ Init()
Initialize the global logger.
- Parameters
-
[in] | _directory | Name of directory that holds the log file. |
[in] | _filename | Name of the log file to write output into. |
- Returns
- True when the initialization succeed or false otherwise.
◆ Prefix()
◆ Root()
Access the global gz console logger.
- Returns
- The gz consoler logger.
◆ SetPrefix()
static void SetPrefix |
( |
const std::string & |
_customPrefix | ) |
|
|
static |
Add a custom prefix in front of the default prefixes.
By default, the custom prefix is an empty string, so the messages start as:
[Err], [Wrn], [Msg], [Dbg]
If you set the prefix to "-my-", for example, they become:
-my-[Err], -my-[Wrn], -my-[Msg], -my-[Dbg]
- Parameters
-
[in] | _customPrefix | Prefix string. |
- See also
- std::string Prefix() const
◆ SetVerbosity()
static void SetVerbosity |
( |
const int |
_level | ) |
|
|
static |
Set verbosity, where 0: Critical messages, 1: Critical, error messages, 2: Critical, error and warning messages, 3: Critical, error, warning, and info messages, 4: Critical, error, warning, info, and debug messages. 5: Critical, error, warning, info, debug, and trace messages.
- Parameters
-
[in] | _level | The new verbose level. |
◆ Verbosity()
◆ initialized
The documentation for this class was generated from the following file: