ROOT logo
HYDRA - THE HADES ANALYSIS PACKAGE » UTIL » HMessageMgr

class HMessageMgr: public TNamed

_HADES_CLASS_DESCRIPTION


  HMessageMgr

  This class manages three different outputs for all kind of messages.
  Besides the standart output, which is the default, one can also
  write the messages to a file, or via a socket to a remote logging process.

  The usage of this class should be done via the four macros that are defined
  in the hmessagemgr.h file.
  DEBUG_msg(level, det, text)
  ERROR_msg(det, text)
  WARNING_msg(level, det, text)
  INFO_msg(level, det, text)

  The meaning of the parameters is:
  level - level of this message, never set it to zero because this means
          no message at all will be printed
  det   - detector which sends this message, can be one of:
          DET_RICH DET_START DET_MDC DET_TOF DET_TOFINO DET_SHOWER
          DET_TRIGGER
  text  - text to print


Function Members (Methods)

public:
HMessageMgr(const HMessageMgr&)
HMessageMgr(const Char_t* name, const Char_t* title)
virtual~HMessageMgr()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
voiddebug(Char_t level, Int_t det, const Char_t* className, const Char_t* text)
voiddebug(Int_t level, Int_t det, const Char_t* className, const Char_t* text)
voiddebug(Int_t level, Int_t det, const Char_t* className, const Char_t* file, Int_t line, const Char_t* text)
voiddebugB(Char_t level, Int_t det, const Char_t* text)
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
voidenableDetectorMsg(Int_t det)
virtual voidTObject::Error(const char* method, const char* msgfmt) const
voiderror(Char_t level, Int_t det, const Char_t* className, const Char_t* text)
voiderror(Int_t level, Int_t det, const Char_t* className, const Char_t* text)
voiderrorB(Char_t level, Int_t det, const Char_t* text)
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
static voidhydraErrorHandler(Int_t level, Bool_t abort, const Char_t* location, const Char_t* msg)
virtual voidTObject::Info(const char* method, const char* msgfmt) const
voidinfo(Char_t level, Int_t det, const Char_t* className, const Char_t* text)
voidinfo(Int_t level, Int_t det, const Char_t* className, const Char_t* text)
voidinfoB(Char_t level, Int_t det, const Char_t* text)
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
voidmessageSeperator(const Char_t* seperator, Int_t num)
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
HMessageMgr&operator=(const HMessageMgr&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTNamed::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidsetDebugLevel(Char_t level)
Bool_tsetDefault()
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidsetF(const Char_t* name)
Bool_tsetFile(const Char_t* dir)
voidsetInfoLevel(Char_t level)
voidsetL(Int_t num)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
Bool_tsetPort(const Char_t* host, Int_t port)
voidsetScreenOutput(Bool_t f = kTRUE)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
voidsetWarningLevel(Char_t level)
virtual voidShowMembers(TMemberInspector&)
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
Bool_tswitchOff()
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
voidwarning(Char_t level, Int_t det, const Char_t* className, const Char_t* text)
voidwarning(Int_t level, Int_t det, const Char_t* className, const Char_t* text)
voidwarningB(Char_t level, Int_t det, const Char_t* text)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidewrite(const Char_t* text)
voidTObject::MakeZombie()
voidwrite(const Char_t* text)

Data Members

public:
enum Detector { DET_RICH
DET_START
DET_MDC
DET_TOF
DET_TOFINO
DET_SHOWER
DET_TRIGGER
DET_RUNTIMEDB
DET_KICKPLANE
DET_QA
DET_ALL
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
TStringTNamed::fNameobject identifier
TStringTNamed::fTitleobject title
private:
Char_tdebugLevel!< Level up to which the messages wil be printed.
Int_tdetectorMsg!< Bitmask fo which detector to print messages
ofstream*errorFile!< File to write error messages to
TSocket*errorSocket!< Socket to send error messages to
Char_t*file!< pointer to store name of file where message comes from
Char_tinfoLevel!< Level up to which the messages wil be printed.
Int_tline!< line in file where message comes from
Char_t*msg1!< internal message variable
Char_t*msg2!< internal message variable
ofstream*msgFile!< File to write messages to (debug,warning,info)
TSocket*msgSocket!< Socket to send messages to (debug,warning,info)
Bool_tscreen!< write to stdout in addition to file or socket
TString*thisHost!< Name of this host
Char_twarningLevel!< Level up to which the messages wil be printed.

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

HMessageMgr(const Char_t* name, const Char_t* title)
 This is the default constructor inherited from TNamed.

  Sets default logging to stdout and stderr.
  The default levels are: no debugging, but all of error, warning and info.
  param name Name of the object
  param title Title of the object
~HMessageMgr(void)
 Resets the message logging to ist default.
  Closses all loggfiles or open sockets, and loggs further messages to
  stdout and stderr.
  Also the loglevels are set to the same values as in the constructor.
Bool_t setDefault(void)
  Closses all loggfiles or open sockets, and loggs further messages to
  stdout and stderr.
  Also the loglevels are set to the same values as in the constructor.
Bool_t setFile(const Char_t* dir)
 Sets the logfile.
 Input is the directory to where to log to.
 The filename is derived from the name of this object, that is given
 when creating it.
 Two files are created. One with extension .msg for all messages of
 type info, warning and debug.
 The other one with extension .err fo the error messages.
 param dir Directory where to store the logfiles.
 retval setFile Returns kTRUE if file could be opened, otherwise kFALSE.
Bool_t setPort(const Char_t* host, Int_t port)
 Opens two socket connections to a logging server on the specified host.
 The passed port is used for the message logging. Errors are send to
 the portaddress port + 10.
 eventually opened logfiles are closed, if the connection could be opened.
 Otherwise the current logging stays active.
 param host Name of the host to send the logmessages to.
 param port Port to use for communication with remote process.
 retval setPort Returns kTRUE if remote process could be contacted, otherwise
 kFALSE is returned.
Bool_t switchOff(void)
 Switches of the logging completly by setting the output to /dev/null.
 Could probably done also by redirecting stdout and stderr to /dev/null.
 Currently opened files or sockets are closed.
 retval switchOff Returns kTRUE on succsess, kFALSE otherwise.
void setDebugLevel(Char_t level)
 Sets the level of debug messages to level.
 param level Level of debugging, max 10 min 0.
void setInfoLevel(Char_t level)
 Sets the level of info messages to level.
 param level Level of information, max 10 min 0.
void setWarningLevel(Char_t level)
 Sets the level of warning messages to level.
  param level Level of warning, max 10 min 0.
void enableDetectorMsg(Int_t det)
 Selects for which detector messages should be displayed.
 param det An or'd pattern of the DET_* constants.
void messageSeperator(const Char_t* seperator, Int_t num)
 This function prints a line with character seperator.
 The seperator character is repeated num times on this line.
 param seperator character to be used as seperator
 param num How often the character is to be repeated on the same line.
void hydraErrorHandler(Int_t level, Bool_t abort, const Char_t* location, const Char_t* msg)
 Message handler for ROOT. Can be installed via gSystem->SetErrorHandler()
 Used by all ROOT classes to do message logging.
 Gives a common message layout.
 param level Level of logging
 param abort Wether to abort the execution after the printing of the message
 param location Location of the message
 param msg Text to be printed.
void debug(Char_t level, Int_t det, const Char_t* className, const Char_t* text)
 This function should never be called directly, use the DEBUG macro instead.
 This function writes a debug message to the output.
 It looks like this example:<br>
 debug  <Hades          >:No input specified<p>
 param level Level of message logging
 param det One of the DET_* constants that defines the detector printing this message.
 param className Name of the class that prints this message.
 param text Text to 'print.
void error(Char_t level, Int_t det, const Char_t* className, const Char_t* text)
 This function should never be called directly, use the ERROR macro instead.
 This function writes a error message to the output.
 It looks like this example:<br>
 error  <Hades          >:No input specified<p>
 param level Level of message logging
 param det One of the DET_* constants that defines the detector printing this message.
 param className Name of the class that prints this message.
 param text Text to print.
void warning(Char_t level, Int_t det, const Char_t* className, const Char_t* text)
 This function should never be called directly, use the WARNING macro instead.
 This function writes a warning message to the output.
 It looks like this example:<br>
 warning<Hades          >:No input specified<p>
 param level Level of message logging
 param det One of the DET_* constants that defines the detector printing this message.
 param className Name of the class that prints this message.
 param text Text to print.
void info(Char_t level, Int_t det, const Char_t* className, const Char_t* text)
 This function should never be called directly, use the INFO macro instead.
 This function writes a info message to the output.
  It looks like this example:<br>
  info<         Hades>:No input specified<p>
 param level Level of message logging
 param det One of the DET_* constants that defines the detector printing this message.
 param className Name of the class that prints this message.
 param text Text to print.
void debug(Int_t level, Int_t det, const Char_t *className, const Char_t *text, ...)
 This function put out an error message including some variable arguments.
 The text parameter takes the standart parameters as in printf().
 The output looks like:<br>
 debug<         Hades>:No input specified<p>
 param level Level of message logging
 param det One of the DET_* constants that defines the detector printing this message.
 param className Name of the class that prints this message.
 param text Text to print.
 param ... Variable number of arguments, that will be used to fill the text
void error(Int_t level, Int_t det, const Char_t *className, const Char_t *text, ...)
 This function put out an error message including some variable arguments.
 The text parameter takes the standart parameters as in printf().
  The output looks like:<br>
  error<         Hades>:No input specified<p>
 param level Level of message logging
 param det One of the DET_* constants that defines the detector printing this message.
 param className Name of the class that prints this message.
 param text Text to print.
 param ... Variable number of arguments, that will be used to fill the text
void warning(Int_t level, Int_t det, const Char_t *className, const Char_t *text, ...)
 This function put out an warning message including some variable arguments.
 The text parameter takes the standart parameters as in printf().
 The output looks like:<br>
 warning<         Hades>:No input specified<p>
 param level Level of message logging
 param det One of the DET_* constants that defines the detector printing this message.
 param className Name of the class that prints this message.
 param text Text to print.
 param ... Variable number of arguments, that will be used to fill the text
void info(Int_t level, Int_t det, const Char_t *className, const Char_t *text, ...)
 This function put out an info message including some variable arguments.
 The text parameter takes the standart parameters as in printf().
  The output looks like:<br>
  info<         Hades>:No input specified<p>
 param level Level of message logging
 param det One of the DET_* constants that defines the detector printing this message.
 param className Name of the class that prints this message.
 param text Text to print.
 param ... Variable number of arguments, that will be used to fill the text
void debugB(Char_t level, Int_t det, const Char_t *text, ...)
 This function put out an error message including some variable arguments.
 The text parameter takes the standart parameters as in printf().
 The output looks like:<br>
 debug<         Hades>:No input specified<p>
 param level Level of message logging
 param det One of the DET_* constants that defines the detector printing this message.
 param className Name of the class that prints this message.
 param file Filename that prints the message.
 param line Linenumber from where the message is printed.
 param text Text to print.
 param ... Variable number of arguments, that will be used to fill the text
void errorB(Char_t level, Int_t det, const Char_t *text, ...)
 This function put out an error message including some variable arguments.
 The text parameter takes the standart parameters as in printf().
 The output looks like:<br>
 error<         Hades>:No input specified<p>
 param level Level of message logging
 param det One of the DET_* constants that defines the detector printing this message.
 param text Text to print.
 param ... Variable number of arguments, that will be used to fill the text
void warningB(Char_t level, Int_t det, const Char_t *text, ...)
 This function put out an warning message including some variable arguments.
 The text parameter takes the standart parameters as in printf().
 The output looks like:<br>
 warning<         Hades>:No input specified<p>
 param level Level of message logging
 param det One of the DET_* constants that defines the detector printing this message.
 param text Text to print.
 param ... Variable number of arguments, that will be used to fill the text
void infoB(Char_t level, Int_t det, const Char_t *text, ...)
 This function put out an info message including some variable arguments.
 The text parameter takes the standart parameters as in printf().
 The output looks like:<br>
 info<         Hades>:No input specified<p>
 param level Level of message logging
 param det One of the DET_* constants that defines the detector printing this message.
 param text Text to print.
 param ... Variable number of arguments, that will be used to fill the text
void debug(Int_t level, Int_t det, const Char_t * className, const Char_t *file, Int_t line, const Char_t *text, ...)
 This function put out an error message including some variable arguments.
 The text parameter takes the standart parameters as in printf().
 The output looks like:<br>
 debug<         Hades>:No input specified<p>
 param level Level of message logging
 param det One of the DET_* constants that defines the detector printing this message.
 param file Filename that prints the message.
 param line Linenumber from where the message is printed.
 param text Text to print.
 param ... Variable number of arguments, that will be used to fill the text
void write(const Char_t* text)
 Internal function used to write to the correct output.
 Used for info, warning and debug messages.
 Adds the name of the host the code is running on, if output is send via
 socket to a remote logging process.
 If screen is set to kTRUE the output is writen to stdout in addition to
 the logfile.
 param text Text to be writen to specified target.
void ewrite(const Char_t* text)
 Internal function used to write to the correct output.
 Used for error messages.
 Adds the name of the host the code is running on, if output is send via
 socket to a remote logging process.
 If screen is set to kTRUE the output is writen to stdout in addition to
 the logfile.
 param text Text to be writen to specified target.
void setF(const Char_t* name)
 Sets the filename for the debug messages.
 The filenames are printed when the debug level is set.
 param name Name of the file that wants to print a message soon.
void setL(Int_t num)
 Sets the linenumber for the debug message.
 The linenumber is printed when the debug level is set.
 param num Linenumber of message.
HMessageMgr(const Char_t* name, const Char_t* title)
void setScreenOutput(Bool_t f = kTRUE)
 Enable output to stdout even if writen to file.
{screen = f;}