Last change
on this file since 693 was
400,
checked in by arnault, 17 years ago
|
Text formatting
Sending warnings & errors to stderr
Using internally PWD for every cd/pwd
CL 327
|
-
Property svn:eol-style set to
native
|
File size:
1.3 KB
|
Line | |
---|
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 | //#include <stdio.h> |
---|
8 | //#include <stdlib.h> |
---|
9 | //#include <stdio.h> |
---|
10 | //#include <string.h> |
---|
11 | #include "cmt_std.h" |
---|
12 | //#include "cmt_string.h" |
---|
13 | |
---|
14 | #include "cmt_log.h" |
---|
15 | #include "cmt.h" |
---|
16 | |
---|
17 | CmtLog::CmtLog () |
---|
18 | { |
---|
19 | } |
---|
20 | |
---|
21 | CmtLogEnd& CmtLog::end () |
---|
22 | { |
---|
23 | static CmtLogEnd me; |
---|
24 | |
---|
25 | return (me); |
---|
26 | } |
---|
27 | |
---|
28 | bool CmtLog::check () |
---|
29 | { |
---|
30 | if (Cmt::get_debug ()) return (true); |
---|
31 | return (false); |
---|
32 | } |
---|
33 | |
---|
34 | CmtLog& CmtLog::operator << (const char* c) |
---|
35 | { |
---|
36 | if (!check ()) return (*this); |
---|
37 | |
---|
38 | cerr << c; |
---|
39 | return (*this); |
---|
40 | } |
---|
41 | |
---|
42 | CmtLog& CmtLog::operator << (const cmt_string& s) |
---|
43 | { |
---|
44 | if (!check ()) return (*this); |
---|
45 | |
---|
46 | cerr << s; |
---|
47 | return (*this); |
---|
48 | } |
---|
49 | |
---|
50 | CmtLog& CmtLog::operator << (int i) |
---|
51 | { |
---|
52 | if (!check ()) return (*this); |
---|
53 | |
---|
54 | cerr << i; |
---|
55 | return (*this); |
---|
56 | } |
---|
57 | |
---|
58 | CmtLog& CmtLog::operator << (double d) |
---|
59 | { |
---|
60 | if (!check ()) return (*this); |
---|
61 | |
---|
62 | cerr << d; |
---|
63 | return (*this); |
---|
64 | } |
---|
65 | |
---|
66 | CmtLog& CmtLog::operator << (void* p) |
---|
67 | { |
---|
68 | if (!check ()) return (*this); |
---|
69 | |
---|
70 | cerr << p; |
---|
71 | return (*this); |
---|
72 | } |
---|
73 | |
---|
74 | CmtLog& CmtLog::operator << (CmtLogEnd& end) |
---|
75 | { |
---|
76 | if (!check ()) return (*this); |
---|
77 | |
---|
78 | cerr << endl; |
---|
79 | return (*this); |
---|
80 | } |
---|
81 | |
---|
82 | CmtLog& CmtLog::operator << (CmtLogDummy& end) |
---|
83 | { |
---|
84 | return (*this); |
---|
85 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.