Last change
on this file since 359 was
347,
checked in by ymipsl, 12 years ago
|
- Supress lot of shared_ptr
- instrument code for vampir-trace and timer diagnostic
YM
|
File size:
737 bytes
|
Rev | Line | |
---|
[300] | 1 | #ifndef __XIOS_LOG__ |
---|
| 2 | |
---|
| 3 | #include <iostream> |
---|
| 4 | |
---|
[335] | 5 | namespace xios |
---|
[300] | 6 | { |
---|
| 7 | using namespace std ; |
---|
| 8 | |
---|
| 9 | class CLog : public ostream |
---|
| 10 | { |
---|
| 11 | public : |
---|
[347] | 12 | CLog(const string& name_) : ostream(cout.rdbuf()),level(0),name(name_) {} |
---|
[300] | 13 | CLog& operator()(int l) |
---|
| 14 | { |
---|
| 15 | if (l<=level) |
---|
| 16 | { |
---|
| 17 | rdbuf(cout.rdbuf()) ; |
---|
[347] | 18 | *this<<"-> "<<name<<" : " ; |
---|
[300] | 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 ; |
---|
[347] | 30 | string name ; |
---|
[300] | 31 | }; |
---|
| 32 | |
---|
| 33 | extern CLog info; |
---|
[347] | 34 | extern CLog report; |
---|
[300] | 35 | } |
---|
| 36 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.