#ifndef ALIHLTLOGGING_H
#define ALIHLTLOGGING_H
-/* This file is property of and copyright by the ALICE HLT Project *
- * ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
+///* This file is property of and copyright by the *
+///* ALICE Experiment at CERN, All rights reserved. *
+///* See cxx source for full Copyright notice */
-/** @file AliHLTLogging.h
- @author Matthias Richter, Timm Steinbeck
- @date
- @brief HLT module logging primitives.
-*/
+/// @file AliHLTLogging.h
+/// @author Matthias Richter, Timm Steinbeck
+/// @date
+/// @brief HLT module logging primitives.
+///
#include "AliHLTDataTypes.h"
#include "AliHLTStdIncludes.h"
/**
* Set a temporary keyword
+ * Keywords need to be static const strings, the class handles only
+ * pointers and assumes the strings to be persistent.
* returns the old key value
*/
const char* SetKeyword(const char* keyword)
*/
static void SetLocalLoggingDefault(AliHLTComponentLogSeverity level);
+ /**
+ * Get default setting for local logging filter for individual objects.
+ */
+ static AliHLTComponentLogSeverity GetLocalLoggingDefault() { return fgLocalLogDefault; }
+
/**
* Get local logging level
* logging filter for individual object
* @param bAppend append to current content
* @return const char string with the formatted message
*/
- static const char* BuildLogString(const char *format, va_list ap, bool bAppend=false);
+ static const char* BuildLogString(const char *format, va_list &ap, bool bAppend=false);
/**
* Set the log string from format specifier and from variable arguments.
/** groups of classes not to print debug messages */
static TString fgWhiteList; //! transient
- ClassDef(AliHLTLogging, 3)
+ ClassDef(AliHLTLogging, 0)
};
/* the class AliHLTKeyword is a simple helper class used by the HLTLogKeyword macro
* HLTLogKeyword("a keyword") creates an object of AliHLTKeyword which sets the keyword for the logging class
* the object is destroyed automatically when the current scope is left and so the keyword is set
- * to the original value
+ * to the original value. Please note that all keywords need to be static strings, only pointyers
+ * are handled and the strings required to ber persistent.
*/
class AliHLTKeyword {
public:
{
}
- AliHLTKeyword(AliHLTLogging* parent, const char* keyword)
+ AliHLTKeyword(const AliHLTLogging* parent, const char* keyword)
:
- fpParent(parent),
+ fpParent(const_cast<AliHLTLogging*>(parent)),
fpOriginal(NULL)
{
- if (parent) {
+ // the const cast is on purpose in order to be allowed to use
+ // HLTLogKeyword from const member functions
+ if (fpParent) {
fpOriginal=fpParent->SetKeyword(keyword);
}
}
- AliHLTKeyword(const AliHLTKeyword& kw)
- :
- fpParent(kw.fpParent),
- fpOriginal(kw.fpOriginal)
- {
- }
-
- AliHLTKeyword& operator=(const AliHLTKeyword& kw)
- {
- fpParent=kw.fpParent;
- fpOriginal=kw.fpOriginal;
- return *this;
- }
-
~AliHLTKeyword()
{
if (fpParent) {
}
private:
+ /// copy constructor prohibited
+ AliHLTKeyword(const AliHLTKeyword& kw);
+ /// assignment operator prohibited
+ AliHLTKeyword& operator=(const AliHLTKeyword& kw);
+
AliHLTLogging* fpParent; //! transient
const char* fpOriginal; //! transient
};