source: XMLIO_V2/dev/common/src/log.hpp @ 300

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

nouvelle version de developpement de xios

  • nouvelle interface fortran
  • recodage complet de la couche de communication
  • et bien d'autres choses...

YM

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