source: CMT/v1r18p20041201/source/cmt_log.cxx @ 1

Last change on this file since 1 was 1, checked in by arnault, 19 years ago

Import all tags

File size: 1.4 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
17CmtLog::CmtLog ()
18{
19}
20
21CmtLogEnd& CmtLog::end ()
22{
23  static CmtLogEnd me;
24
25  return (me);
26}
27
28bool CmtLog::check ()
29{
30  if (Cmt::get_debug ()) return (true);
31  return (false);
32}
33
34CmtLog& CmtLog::operator << (const char* c)
35{
36  if (!check ()) return (*this);
37
38  cout << c;
39  return (*this);
40}
41
42CmtLog& CmtLog::operator << (const cmt_string& s)
43{
44  if (!check ()) return (*this);
45
46  cout << s;
47  return (*this);
48}
49
50CmtLog& CmtLog::operator << (int i)
51{
52  if (!check ()) return (*this);
53
54  cout << i;
55  return (*this);
56}
57
58CmtLog& CmtLog::operator << (double d)
59{
60  if (!check ()) return (*this);
61
62  cout << d;
63  return (*this);
64}
65
66CmtLog& CmtLog::operator << (void* p)
67{
68  if (!check ()) return (*this);
69
70  cout << p;
71  return (*this);
72}
73
74CmtLog& CmtLog::operator << (CmtLogEnd& end)
75{
76  if (!check ()) return (*this);
77
78  cout << endl;
79  return (*this);
80}
81
82CmtLog& CmtLog::operator << (CmtLogDummy& end)
83{
84  return (*this);
85}
Note: See TracBrowser for help on using the repository browser.