Rev | Line | |
---|
[1] | 1 | //----------------------------------------------------------- |
---|
| 2 | // Copyright Christian Arnault LAL-Orsay CNRS |
---|
| 3 | // arnault@lal.in2p3.fr |
---|
| 4 | // See the complete license in cmt_license.txt "http://www.cecill.info". |
---|
| 5 | //----------------------------------------------------------- |
---|
| 6 | |
---|
| 7 | #ifndef __cmt_log_h__ |
---|
| 8 | #define __cmt_log_h__ |
---|
| 9 | |
---|
| 10 | #include "cmt_string.h" |
---|
| 11 | |
---|
| 12 | class CmtLogEnd |
---|
| 13 | { |
---|
| 14 | public: |
---|
| 15 | }; |
---|
| 16 | |
---|
| 17 | class CmtLogDummy |
---|
| 18 | { |
---|
| 19 | public: |
---|
| 20 | }; |
---|
| 21 | |
---|
| 22 | class CmtLog |
---|
| 23 | { |
---|
| 24 | public: |
---|
| 25 | CmtLog (); |
---|
| 26 | |
---|
| 27 | static CmtLogEnd& end (); |
---|
| 28 | CmtLog& operator << (const cmt_string& s); |
---|
| 29 | CmtLog& operator << (const char* c); |
---|
| 30 | CmtLog& operator << (int i); |
---|
| 31 | CmtLog& operator << (double d); |
---|
| 32 | CmtLog& operator << (void* p); |
---|
| 33 | CmtLog& operator << (CmtLogEnd& end); |
---|
| 34 | CmtLog& operator << (CmtLogDummy& dummy); |
---|
| 35 | |
---|
| 36 | private: |
---|
| 37 | bool check (); |
---|
| 38 | }; |
---|
| 39 | |
---|
| 40 | #define Log static CmtLog log_instance |
---|
| 41 | #define log_endl CmtLog::end () |
---|
| 42 | #define log if (Cmt::get_debug ()) log_instance << "#CMT> (" << __FILE__ << "-" << __LINE__ << ") " |
---|
| 43 | #define log_cont if (Cmt::get_debug ()) log_instance |
---|
| 44 | |
---|
| 45 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.