source: XIOS/trunk/src/log.hpp @ 369

Last change on this file since 369 was 369, checked in by ymipsl, 12 years ago

Major Update

  • redesign Type and attribute manipulation
  • add enumerate type and attribute
  • use blitz class array instead of boost class array

YM

File size: 773 bytes
Line 
1#ifndef __XIOS_LOG__
2
3#include <string>
4#include <iostream>
5#include <string>
6
7namespace xios
8{
9  using namespace std ;
10
11  class CLog : public ostream
12  {
13    public :
14    CLog(const string& name_) : ostream(cout.rdbuf()),level(0),name(name_) {}
15    CLog& operator()(int l) 
16    { 
17      if (l<=level) 
18      {
19        rdbuf(cout.rdbuf()) ;
20        *this<<"-> "<<name<<" : " ;
21      }
22      else rdbuf(NULL) ;
23      return *this;
24    }
25    void setLevel(int l) {level=l; } 
26    int getLevel() {return level ;}
27    bool isActive(void) { if (rdbuf()==NULL) return true ; else return false ;}
28    bool isActive(int l) {if (l<=level) return true ; else return false ; }
29
30    private :
31    int level ;
32    string name ;
33  };
34
35  extern CLog info;
36  extern CLog report;
37}
38#endif
Note: See TracBrowser for help on using the repository browser.