SFrame 3.6
core/src/SErrorHandler.cxx File Reference
#include <map>
#include <cstdlib>
#include <TSystem.h>
#include <TError.h>
#include "core/include/SErrorHandler.h"
#include "core/include/SLogger.h"
Include dependency graph for SErrorHandler.cxx:

Go to the source code of this file.

Functions

void SErrorHandler (int level, Bool_t abort, const char *location, const char *message)
 Function printing log messages from ROOT.
Int_t SetSErrorHandler ()

Variables

static std::map< int, SMsgTypemsgLevelMap
 Local map to translate between ROOT and SFrame message levels.
static Int_t dummy = SetSErrorHandler()

Function Documentation

void SErrorHandler ( int  level,
Bool_t  abort,
const char *  location,
const char *  message 
)

Function printing log messages from ROOT.

This function is the "SFrame version" of DefaultErrorHandler defined in the TError.h header. By calling

SetErrorHandler( SErrorHandler )

somewhere at the beginning of the application, we can channel all ROOT messages through our own message logging facility.

Parameters:
levelROOT message level
abortFlag telling that the process should abort execution
locationThe source of the message
messageThe message itself

Definition at line 44 of file SErrorHandler.cxx.

References SLogger::endmsg(), ERROR, FATAL, INFO, msgLevelMap, and WARNING.

Referenced by SetSErrorHandler().

Int_t SetSErrorHandler ( )

The following code makes sure that SetErrorHandler(SErrorHandler) is called when loading the SFrameCore library. This way all ROOT messages get printed using SLogger on the PROOF workers from the moment the SFrame libraries are loaded. (This is one of the first things that the workers do...)

I "stole" the idea for this kind of code from RooFit actually...

Definition at line 92 of file SErrorHandler.cxx.

References DEBUG, SLogger::endmsg(), and SErrorHandler().


Variable Documentation

Int_t dummy = SetSErrorHandler() [static]

Definition at line 106 of file SErrorHandler.cxx.

std::map< int, SMsgType > msgLevelMap [static]

Local map to translate between ROOT and SFrame message levels.

Definition at line 26 of file SErrorHandler.cxx.

Referenced by SErrorHandler().