New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
log.hpp in vendors/XIOS/current/src – NEMO

source: vendors/XIOS/current/src/log.hpp @ 3408

Last change on this file since 3408 was 3408, checked in by rblod, 12 years ago

importing initial XIOS vendor drop

  • Property svn:keywords set to Id
File size: 737 bytes
Line 
1#ifndef __XIOS_LOG__
2
3#include <iostream>
4
5namespace xios
6{
7  using namespace std ;
8
9  class CLog : public ostream
10  {
11    public :
12    CLog(const string& name_) : ostream(cout.rdbuf()),level(0),name(name_) {}
13    CLog& operator()(int l) 
14    { 
15      if (l<=level) 
16      {
17        rdbuf(cout.rdbuf()) ;
18        *this<<"-> "<<name<<" : " ;
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    string name ;
31  };
32
33  extern CLog info;
34  extern CLog report;
35}
36#endif
Note: See TracBrowser for help on using the repository browser.