Helper Class to send consistently formatted messages. It allows different levels of severity for the messages: Info, Warning and Error.
More...
#include <XeUtils.h>
|
| errorHandler (TString name) |
|
void | Error (TString functionName, TString message) |
| Send an Error message to the user. More...
|
|
void | Warning (TString functionName, TString message) |
| Send a Warning message to the user. More...
|
|
void | Info (TString functionName, TString message) |
| Send an Info message to the user. More...
|
|
void | Debug (TString functionName, TString message) |
| Send a Debug message to the user. More...
|
|
void | setPrintLevel (int level) |
| Set the local printing level (for this instance only) More...
|
|
int | getPrintLevel () |
| Return the current print level for this instance. remind that if you set with setPrintLevel this will override the global print level.
|
|
Helper Class to send consistently formatted messages. It allows different levels of severity for the messages: Info, Warning and Error.
Error actually throws an error with the std::runtime_error() which will abort (no so) gracefully and quit Xephyr, whatever it is doing.
◆ errorHandler()
errorHandler::errorHandler |
( |
TString |
name | ) |
|
Constructor:
- Parameters
-
name | Tag name, typically here you wanna put the name of the class for which you wanna handle errors. |
◆ Debug()
void errorHandler::Debug |
( |
TString |
functionName, |
|
|
TString |
message |
|
) |
| |
Send a Debug message to the user.
Send a message with DEBUG severity, Xephyr will continue.
- Parameters
-
functionName | Tag identifier, function or in general reference place in the code where this message has been produced. |
message | message to the user. |
◆ Error()
void errorHandler::Error |
( |
TString |
functionName, |
|
|
TString |
message |
|
) |
| |
Send an Error message to the user.
Send a message with ERROR severity, Xephyr will quit.
- Parameters
-
functionName | Tag identifier, function or in general reference place in the code where this message has been produced. |
message | message to the user. |
◆ Info()
void errorHandler::Info |
( |
TString |
functionName, |
|
|
TString |
message |
|
) |
| |
Send an Info message to the user.
Send a message with INFO severity, Xephyr will continue.
- Parameters
-
functionName | Tag identifier, function or in general reference place in the code where this message has been produced. |
message | message to the user. |
◆ setPrintLevel()
void errorHandler::setPrintLevel |
( |
int |
level | ) |
|
|
inline |
Set the local printing level (for this instance only)
The print level is defined globally, if you want to modify, increase reduce the verbosity of this particular instance you can set its print level.
- Parameters
-
level | the print level you wanna set. Default is < 0 which means all, 0 = Debug + Info + Warning + Error, 1 = Info + Warning + Error, 2 = Warning + Error, 3 = Error only. you can modify the global print level with errorHandler::globalPrintLevel = XX |
◆ Warning()
void errorHandler::Warning |
( |
TString |
functionName, |
|
|
TString |
message |
|
) |
| |
Send a Warning message to the user.
Send a message with WARNING severity, Xephyr will continue.
- Parameters
-
functionName | Tag identifier, function or in general reference place in the code where this message has been produced. |
message | message to the user. |
◆ globalPrintLevel
int errorHandler::globalPrintLevel = 1 |
|
static |
global print level by default set to all. 0 = Debug-print all, 1 = Info + Warning + Error, 2 = Warning + Error, 3 = Only error
◆ localPrintLevel
int errorHandler::localPrintLevel |
local print level for this instance modify it with setPrintLevel.
The documentation for this class was generated from the following files: