14 #ifndef ClassStMessMgr
15 #define ClassStMessMgr
23 #error An attempt to redefine the LOGGERMESSAGE macro
25 # define LOGGERMESSAGE(MESSAGELEVEL) \
26 if (StMessMgr::CurrentMessager()->_NAME3_(is,MESSAGELEVEL,Enabled)()) \
27 StMessMgr::CurrentMessager()->MESSAGELEVEL("","O",__FUNCTION__, __LINE__)
29 # define LOG_INFO LOGGERMESSAGE(Info)
30 # define LOG_WARN LOGGERMESSAGE(Warning)
31 # define LOG_ERROR LOGGERMESSAGE(Error)
32 # define LOG_FATAL LOGGERMESSAGE(Fatal)
33 # define LOG_DEBUG LOGGERMESSAGE(Debug)
34 # define LOG_QA LOGGERMESSAGE(QAInfo)
35 # define LOG_UCM LOGGERMESSAGE(UCMInfo)
37 #define STAR_INFO(name) \
38 GetLogger(_QUITE_(name))->MESSAGELEVEL(__FUNCTION__, __LINE__)
40 #define MSG_INFO(name) \
41 GetLogger(_QUITE_(name))->MESSAGELEVEL(__FUNCTION__, __LINE__)
46 #include "StarCallf77.h"
47 #define Message_ F77_NAME(message,MESSAGE)
48 #define Msg_Enable_ F77_NAME(msg_enable,MSG_ENABLE)
49 #define Msg_Enabled_ F77_NAME(msg_enabled,MSG_ENABLED)
50 #define Msg_Disable_ F77_NAME(msg_disable,MSG_DISABLE)
51 #define StMessage_ F77_NAME(stmessage,STMESSAGE)
52 #define StInfo_ F77_NAME(stinfo,STINFO)
53 #define StWarning_ F77_NAME(stwarning,STWARNING)
54 #define StError_ F77_NAME(sterror,STERROR)
55 #define StDebug_ F77_NAME(stdebug,STDEBUG)
56 #define QAInfo_ F77_NAME(qainfo,QAINFO)
57 #define UCMInfo_ F77_NAME(ucminfo,UCMINFO)
58 #define StInfoOpt_ F77_NAME(stinfoopt,STINFOOPT)
59 #define StWarningOpt_ F77_NAME(stwarningopt,STWARNINGOPT)
60 #define StErrorOpt_ F77_NAME(sterroropt,STERROROPT)
61 #define StDebugOpt_ F77_NAME(stdebugopt,STDEBUGOPT)
62 #define QAInfoOpt_ F77_NAME(qainfoopt,QAINFOOPT)
63 #define UCMInfoOpt_ F77_NAME(ucminfoopt,UCMINFOOPT)
64 #define StMessAddType_ F77_NAME(stmessaddtype,STMESSADDTYPE)
66 void type_of_call Message_(
const char* mess,
int *lines,
int *
id,
size_t len);
67 void type_of_call Msg_Enable_(
const char* mess,
size_t len);
68 int type_of_call Msg_Enabled_(
const char* mess,
int *
id,
size_t len);
69 void type_of_call Msg_Disable_(
const char* mess,
size_t len);
70 void type_of_call MessageOut(
const char* msg);
71 void type_of_call StMessage_(
const char* mess,
const char* type,
72 const char* opt,
size_t len1,
73 size_t len2,
size_t len3);
74 void type_of_call StInfo_(
const char* mess,
size_t len);
75 void type_of_call StWarning_(
const char* mess,
size_t len);
76 void type_of_call StError_(
const char* mess,
size_t len);
77 void type_of_call StDebug_(
const char* mess,
size_t len);
78 void type_of_call QAInfo_(
const char* mess,
size_t len);
79 void type_of_call UCMInfo_(
const char* mess,
size_t len);
80 void type_of_call StInfoOpt_(
const char* mess,
const char* opt,
81 size_t len1,
size_t len2);
82 void type_of_call StWarningOpt_(
const char* mess,
const char* opt,
83 size_t len1,
size_t len2);
84 void type_of_call StErrorOpt_(
const char* mess,
const char* opt,
85 size_t len1,
size_t len2);
86 void type_of_call StDebugOpt_(
const char* mess,
const char* opt,
87 size_t len1,
size_t len2);
88 void type_of_call QAInfoOpt_(
const char* mess,
const char* opt,
89 size_t len1,
size_t len2);
90 void type_of_call UCMInfoOpt_(
const char* mess,
const char* opt,
91 size_t len1,
size_t len2);
92 void type_of_call StMessAddType_(
const char* type,
const char* text,
93 size_t len1,
size_t len2);
109 friend ostream& operator<<(ostream& ,
StMessage*);
119 virtual void IgnoreRepeats() =0;
120 virtual void AllowRepeats() =0;
124 enum ESTARMakerErrorLevels {
125 kAll=-5, kFatal, kError, kWarning, kInfo, kDefault, kDebug, kDebug2
132 virtual std::ostream& OperatorShift(std::ostream& os,
StMessage* stm) = 0;
135 virtual std::ostringstream& Message(
const char* mess=
"",
const char* type=
"",
136 const char* opt=0,
const char *sourceFileName=0,
int lineNumber=-1)= 0;
137 virtual void Print() =0;
138 virtual int PrintList(messVec* list) =0;
139 virtual int PrintAll() =0;
140 virtual StMessage* FindMessage(
const char* s1,
const char s2[]=
"",
141 const char* s3=
"",
const char* s4=
"", messVec* list=0) =0;
142 virtual messVec* FindMessageList(
const char* s1,
const char* s2=
"",
143 const char* s3=
"",
const char* s4=
"", messVec* list=0) =0;
144 virtual int RemoveMessage(
StMessage* mess) =0;
145 virtual int RemoveMessage(
const char* s1,
const char* s2=
"",
146 const char* s3=
"",
const char* s4=
"") =0;
147 virtual void SetLimit(
const char* str,
int n=0) =0;
148 virtual int GetLimit(
const char* str) =0;
149 virtual void ListLimits() =0;
150 virtual void RemoveLimit(
const char* str) =0;
151 virtual void SetLevel(Int_t logLevel) =0;
152 virtual Int_t GetLevel(Int_t logLevel)
const =0;
153 virtual const char *
GetName()
const = 0;
154 virtual void SwitchOff(
const char* str) =0;
155 virtual void SwitchOn(
const char* str) =0;
156 virtual void FixOn(
const char* str) =0;
157 virtual void NoLimits() =0;
158 virtual void Summary(
size_t nTerms=1) =0;
159 virtual void MemorySummary() =0;
160 virtual void MemoryOn() =0;
161 virtual void MemoryOff() =0;
162 virtual int AddType(
const char* type,
const char* text) =0;
163 virtual int ListTypes() =0;
164 virtual void Close() {}
187 virtual bool isDebugEnabled()
const;
188 virtual bool isWarnEnabled()
const;
189 virtual bool isWarningEnabled()
const;
190 virtual bool isErrorEnabled()
const;
191 virtual bool isInfoEnabled()
const;
192 virtual bool isFatalEnabled()
const;
193 virtual bool isEnabledFor()
const;
194 virtual bool isQAInfoEnabled()
const;
195 virtual bool isUCMInfoEnabled()
const;
211 virtual std::ostringstream& Info(
const char* mess=
"",
const char* opt=
"O",
const char *sourceFileName=0,
int lineNumber=-1)=0;
212 virtual int PrintInfos() =0;
213 virtual const messVec* GetInfos() =0;
214 virtual StMessage* FindInfo(
const char* s1,
const char* s2=
"",
215 const char* s3=
"",
const char* s4=
"") =0;
216 virtual messVec* FindInfoList(
const char* s1,
const char* s2=
"",
217 const char* s3=
"",
const char* s4=
"") =0;
220 virtual std::ostringstream& Warning(
const char* mess=
"",
const char* opt=
"E",
const char *sourceFileName=0,
int lineNumber=-1)= 0;
221 virtual int PrintWarnings() =0;
222 virtual const messVec* GetWarnings() =0;
223 virtual StMessage* FindWarning(
const char* s1,
const char* s2=
"",
224 const char* s3=
"",
const char* s4=
"") =0;
225 virtual messVec* FindWarningList(
const char* s1,
const char* s2=
"",
226 const char* s3=
"",
const char* s4=
"") =0;
229 virtual std::ostringstream&
Error(
const char* mess=
"",
const char* opt=
"E",
const char *sourceFileName=0,
int lineNumber=-1) = 0;
230 virtual int PrintErrors() =0;
231 virtual const messVec* GetErrors() =0;
232 virtual StMessage* FindError(
const char* s1,
const char* s2=
"",
233 const char* s3=
"",
const char* s4=
"") =0;
234 virtual messVec* FindErrorList(
const char* s1,
const char* s2=
"",
235 const char* s3=
"",
const char* s4=
"") =0;
238 virtual std::ostringstream& Debug(
const char* mess=
"",
const char* opt=
"OT",
const char *sourceFileName=0,
int lineNumber=-1)= 0;
239 virtual int PrintDebug() =0;
240 virtual const messVec* GetDebugs() =0;
241 virtual StMessage* FindDebug(
const char* s1,
const char* s2=
"",
242 const char* s3=
"",
const char* s4=
"") =0;
243 virtual messVec* FindDebugList(
const char* s1,
const char* s2=
"",
244 const char* s3=
"",
const char* s4=
"") =0;
247 virtual std::ostringstream& QAInfo(
const char* mess=
"",
const char* opt=
"OS",
const char *sourceFileName=0,
int lineNumber=-1) = 0;
248 virtual int PrintQAInfo() =0;
249 virtual const messVec* GetQAInfos() =0;
250 virtual StMessage* FindQAInfo(
const char* s1,
const char* s2=
"",
251 const char* s3=
"",
const char* s4=
"") =0;
252 virtual messVec* FindQAInfoList(
const char* s1,
const char* s2=
"",
253 const char* s3=
"",
const char* s4=
"") =0;
256 virtual std::ostringstream& UCMInfo(
const char* mess=
"",
const char* opt=
"OS",
const char *sourceFileName=0,
int lineNumber=-1) = 0;
257 virtual int PrintUCMInfo() =0;
258 virtual const messVec* GetUCMInfos() =0;
259 virtual StMessage* FindUCMInfo(
const char* s1,
const char* s2=
"",
260 const char* s3=
"",
const char* s4=
"") =0;
261 virtual messVec* FindUCMInfoList(
const char* s1,
const char* s2=
"",
262 const char* s3=
"",
const char* s4=
"") =0;
265 virtual std::ostringstream& out(
const char* mess=
"") = 0;
266 virtual std::ostringstream& err(
const char* mess=
"") = 0;
268 virtual void PrintInfo() =0;
270 virtual std::ostringstream& Fatal(
const char* mess=
"",
const char* opt=
"OT",
const char *sourceFileName=0,
int lineNumber=-1)= 0;
298 inline StTurnLogger::StTurnLogger(
StMessMgr* msg): fMessager(0)
300 if (msg) fMessager = StMessMgr::SetCurrentMessager(msg);
304 inline StTurnLogger::StTurnLogger(
const StTurnLogger& push) : fMessager(push.fMessager)
308 inline StTurnLogger::~StTurnLogger()
309 {
if (fMessager) StMessMgr::SetCurrentMessager(fMessager);}
313 inline ostream& operator<<(ostream& os,
StMessage* stm) {
314 return gMessMgr->OperatorShift(os,stm);
319 return gMessMgr->Info();
323 return gMessMgr->Error();
327 return gMessMgr->out();
331 return gMessMgr->err();
virtual TDataSet * Instance() const
virtual Int_t Instantiate()
Maker-instantiation handler.
virtual const char * GetName() const
special overload