Xephyr  0.0
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
errorHandler Class Reference

Helper Class to send consistently formatted messages. It allows different levels of severity for the messages: Info, Warning and Error. More...

#include <XeUtils.h>

Inheritance diagram for errorHandler:
dataHandler histoCompare pdfComponent ToyFitterExclusion ToyGenerator XeStat AsymptoticExclusion Likelihood LKParameter ProfileLikelihood CombinedParameter scaleSys shapeSys SigmaParameter TEfficiencyParameter TGaussParameter TLEffParameter TQyParameter TStatBkgParameter TSystBkgParameter

Public Member Functions

 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.
 

Public Attributes

int localPrintLevel
 
TString className
 

Static Public Attributes

static int globalPrintLevel = 1
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ errorHandler()

errorHandler::errorHandler ( TString  name)

Constructor:

Parameters
nameTag name, typically here you wanna put the name of the class for which you wanna handle errors.

Member Function Documentation

◆ 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
functionNameTag identifier, function or in general reference place in the code where this message has been produced.
messagemessage 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
functionNameTag identifier, function or in general reference place in the code where this message has been produced.
messagemessage 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
functionNameTag identifier, function or in general reference place in the code where this message has been produced.
messagemessage 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
levelthe 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
functionNameTag identifier, function or in general reference place in the code where this message has been produced.
messagemessage to the user.

Member Data Documentation

◆ 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: