]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/src/AliL3Logger.cxx
Adding protected copy constructor and assignment operator
[u/mrichter/AliRoot.git] / HLT / src / AliL3Logger.cxx
CommitLineData
3e87ef69 1// @8#) $Id$
8ff26a23 2
3e87ef69 3// Author: Anders Vestbo <mailto:vestbo@fi.uib.no>, Constantin Loizides <mailto:loizides@ikf.uni-frankfurt.de>
4//*-- Copyright &copy ALICE HLT Group
8ff26a23 5
118c26c3 6#include "AliL3StandardIncludes.h"
8ff26a23 7
108615fc 8#include "AliL3Logging.h"
108615fc 9#include "AliL3Logger.h"
108615fc 10
4499ed26 11ClassImp(AliL3Logger)
12
91f3257c 13#ifdef use_logging
14
b1ed0288 15Int_t AliL3Logger::fgAll= AliL3Log::kAll;
16Int_t AliL3Logger::fgDebug = AliL3Log::kDebug;
17Int_t AliL3Logger::fgInformational = AliL3Log::kInformational;
18Int_t AliL3Logger::fgWarning = AliL3Log::kWarning;
19Int_t AliL3Logger::fgError = AliL3Log::kError;
20Int_t AliL3Logger::fgFatal = AliL3Log::kFatal;
21
22AliL3Logger::AliL3Logger()
23{
24 //constructor
7573eee0 25 if (!gLogP) {
26 //printf( "Setting gLogP...\n" );
27 //printf( "&gLogP: 0x%08lX\n", (unsigned long)&gLogP );
28 //printf( "gLogP: 0x%08lX\n", (unsigned long)gLogP );
29 gLogP = &MLUCLog::gLog;
30 //printf( "gLogP set\n" );
31 }
32 if (!gLogLevelP){
33 //printf( "Setting gLogLevelP...\n" );
34 gLogLevelP = &MLUCLog::gLogLevel;
35 //printf( "gLogLevelP set...\n" );
36 }
37 (*gLogLevelP)=AliL3Log::kAll;
b1ed0288 38 fdn = fso = fse = fsm =0;
39 fof = 0;
40}
41
42AliL3Logger::~AliL3Logger()
43{
44 //destructor
6e61c746 45 if(fdn) {gLogP->DelServer(fdn);delete fdn;}
46 if(fso) {gLogP->DelServer(fso);delete fso;}
47 if(fse) {gLogP->DelServer(fse);delete fse;}
48 if(fsm) {gLogP->DelServer(fsm);delete fsm;}
b1ed0288 49 if(fof) {fof->close();delete fof;}
50}
51
52void AliL3Logger::Set(Int_t l)
53{
54 //set logger
6e61c746 55 (*gLogLevelP) |=l;
b1ed0288 56}
57
58void AliL3Logger::UnSet(Int_t l)
59{
60 //unset logger
6e61c746 61 (*gLogLevelP) &=(~l);
b1ed0288 62}
63
64void AliL3Logger::UseDevNull()
65{
66 //use dev null
67 if(fdn) return;
68 fdn = new AliL3DevNullLogServer();
6e61c746 69 gLogP->AddServer(fdn);
108615fc 70}
b1ed0288 71void AliL3Logger::UseStdout()
72{
73 //use stdout
74 if(fso)return;
75 fso = new AliL3StdoutLogServer();
6e61c746 76 gLogP->AddServer(fso);
b1ed0288 77}
78void AliL3Logger::UseStderr()
79{
80 //use stderr
81 if(fse) return;
82 fse = new AliL3StderrLogServer();
6e61c746 83 gLogP->AddServer(fse);
b1ed0288 84}
85
86void AliL3Logger::UseStream(Char_t *name)
87{
88 //use stream
89 if(fsm) return;
90 if(fof) fof->close();
91 delete fof;
92 fof = 0;
93 fof = new ofstream();
94 fof->open(name);
95 fsm = new AliL3StreamLogServer(*fof);
6e61c746 96 gLogP->AddServer(fsm);
b1ed0288 97}
98
99void AliL3Logger::NotUseDevNull()
100{
101 //not dev null
6e61c746 102 if(fdn) {gLogP->DelServer(fdn);delete fdn;fdn=0;}
b1ed0288 103}
104
105void AliL3Logger::NotUseStdout()
106{
107 //not stdout
6e61c746 108 if(fso) {gLogP->DelServer(fso);delete fso;fso=0;}
b1ed0288 109}
110
111void AliL3Logger::NotUseStderr()
112{
113 //not stderr
6e61c746 114 if(fse) {gLogP->DelServer(fse);delete fse;fse=0;}
b1ed0288 115}
116
117void AliL3Logger::NotUseStream()
118{
119 //not stream
6e61c746 120 if(fsm) {gLogP->DelServer(fsm);delete fsm;fsm=0;}
b1ed0288 121 if(fof) {fof->close();delete fof;fof=0;}
122}
123
124#else /*not use_logging*/
125
126Int_t AliL3Logger::fgAll= AliL3Log::kAll;
127Int_t AliL3Logger::fgDebug = AliL3Log::kDebug;
128Int_t AliL3Logger::fgInformational = AliL3Log::kInformational;
129Int_t AliL3Logger::fgWarning = AliL3Log::kWarning;
130Int_t AliL3Logger::fgError = AliL3Log::kError;
131Int_t AliL3Logger::fgFatal = AliL3Log::kFatal;
132
133AliL3Logger::AliL3Logger()
134{
135 //
136 ;
137}
138
139AliL3Logger::~AliL3Logger()
140{
141 //
142 ;
143}
144
145void AliL3Logger::Set(Int_t /*l*/)
146{
147 //
148 ;
149}
150
151void AliL3Logger::UnSet(Int_t /*l*/)
152{
153 //
154 ;
155}
156
157void AliL3Logger::UseDevNull()
158{
159 //
160 ;
161}
162
163void AliL3Logger::UseStdout()
164{
165 //
166 ;
167}
168
169void AliL3Logger::UseStderr()
170{
171 //
172 ;
173}
174
175void AliL3Logger::UseStream(Char_t */*name*/)
176{
177 //
178 ;
179}
180
181void AliL3Logger::NotUseDevNull()
182{
183 //
184 ;
185}
186
187void AliL3Logger::NotUseStdout()
188{
189 //
190 ;
191}
192
193void AliL3Logger::NotUseStderr()
194{
195 //
196 ;
197}
198
199void AliL3Logger::NotUseStream()
200{
201 //
202 ;
203}
108615fc 204#endif