]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/BASE/AliHLTLogging.h
adaption to new logging class, added functionality to AliHLTSystem to build a task...
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTLogging.h
CommitLineData
3495cce2 1// @(#) $Id:
2
3#ifndef ALIHLTLOGGING_H
4#define ALIHLTLOGGING_H
5/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 * See cxx source for full Copyright notice */
7
8/* AliHLTLogging
9 the HLT logging methods
10 */
11
12
13#include "AliHLTDataTypes.h"
14#include <TObject.h>
15#include <stdio.h>
16
17#define LOG_BUFFER_SIZE 100 // global logging buffer
18#define LOG_PREFIX "" // logging prefix, for later extensions
19
20#define DebugMsg( ... ) LoggingVarargs(kHLTLogDebug, this->Class_Name() , __func__ , __VA_ARGS__ )
21
22class AliHLTLogging {
23public:
24 AliHLTLogging();
25 virtual ~AliHLTLogging();
26
27 /* logging filter for all objects
28 */
29 static AliHLTComponent_LogSeverity SetGlobalLogLevel(AliHLTComponent_LogSeverity iLogFilter) {fGlobalLogFilter=iLogFilter; return fGlobalLogFilter;}
30
31 /* logging filter for individual object
32 */
33 AliHLTComponent_LogSeverity SetLocalLogLevel(AliHLTComponent_LogSeverity iLogFilter) {fLocalLogFilter=iLogFilter; return fLocalLogFilter;}
34
5ec8e281 35 static int Init(AliHLTfctLogging pFun) { fLoggingFunc=pFun; return 0;}
3495cce2 36
37 // genaral logging function
38 //
39 static int Logging( AliHLTComponent_LogSeverity severity, const char* origin, const char* keyword, const char* message, ... );
40
41 // logging function with two origin parameters, used by the log macros
42 //
43 int LoggingVarargs( AliHLTComponent_LogSeverity severity, const char* origin_class, const char* origin_func, ... );
44
45 // apply filter, return 1 if message should pass
46 //
47 int CheckFilter(AliHLTComponent_LogSeverity severity);
48
49 static int Message(void * param, AliHLTComponent_LogSeverity severity, const char* origin, const char* keyword, const char* message);
50
51 static const char* BuildLogString(const char *format, va_list ap);
52
53 virtual void* GetParameter() {return NULL;}
54protected:
55
56private:
57 static AliHLTComponent_LogSeverity fGlobalLogFilter;
58 AliHLTComponent_LogSeverity fLocalLogFilter;
59 static char fLogBuffer[LOG_BUFFER_SIZE];
60 static char fOriginBuffer[LOG_BUFFER_SIZE];
5ec8e281 61 static AliHLTfctLogging fLoggingFunc;
3495cce2 62
63 ClassDef(AliHLTLogging, 0)
64};
65#endif
66