mummy  1.0.3
MummyLog.h
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 // MummyLog.h
3 //
4 // Author(s) : David Cole
5 //
6 // Copyright (C) 2006-2009 Kitware, Inc.
7 //----------------------------------------------------------------------------
8 
9 #ifndef MummyLog_h
10 #define MummyLog_h
11 
12 #include "MummyUtilities.h" // first mummy include for root classes
13 
14 #include "gxsys/ios/iostream"
15 
20 #define LogFileLineLabelledMsg(os, file, line, label, n, m) \
21  if (ShouldLogMsg(n)) \
22  { \
23  LogMsg(file, line, label, n); \
24  os << file << "(" << line << "): " << label << ": m" << n << ": " m << gxsys_ios::endl; \
25  }
26 
27 
28 #define LogFileLineErrorMsg(file, line, n, m) \
29  LogFileLineLabelledMsg(gxsys_ios::cerr, file, line, "error", n, m)
30 
31 #define LogFileLineWarningMsg(file, line, n, m) \
32  LogFileLineLabelledMsg(gxsys_ios::cerr, file, line, "warning", n, m)
33 
34 #define LogFileLineInfoMsg(file, line, n, m) \
35  LogFileLineLabelledMsg(gxsys_ios::cout, file, line, "info", n, m)
36 
37 
38 // n == number
39 // m == (C++ stream-able) message or string literal
40 //
41 #define LogError(n, m) \
42  LogFileLineErrorMsg("# ", 0, n, m)
43 
44 #define LogWarning(n, m) \
45  LogFileLineWarningMsg("# ", 0, n, m)
46 
47 #define LogInfo(n, m) \
48  LogFileLineInfoMsg("# ", 0, n, m)
49 
50 
51 #define LogVerboseInfo(m) \
52  if (this->GetSettings()->GetVerbose()) \
53  { \
54  LogInfo(mi_VerboseInfo, m); \
55  }
56 
57 
58 // Error (me_), warning (mw_) and info (mi_) values.
59 //
60 // Add new error values to the end of the me_ segment, new warnings to the
61 // end of the mw_ segment and new info values to the end of the mi_ segment.
62 // That way, new builds of mummy will always have the same error and warning
63 // values as previous builds...
64 //
65 // DO NOT be tempted to alphabetize this list. Or, if you are tempted, resist
66 // it with all that is in you... Keep this list ordered the same within each
67 // segment - always!
68 //
70 {
71  // Error values segment:
88 
89  // Warning values segment:
113 
114  // Info values segment:
119 
120  // Always keep this one last:
121  //
123 };
124 
125 #endif
MummyLogMsgValues
Definition: MummyLog.h:69