Changeset 548 for XIOS/branchs/xios-1.0/src/log.hpp
- Timestamp:
- 01/23/15 16:18:43 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/branchs/xios-1.0/src/log.hpp
r501 r548 13 13 { 14 14 public : 15 CLog(const string& name_) : ostream(cout.rdbuf()),level(0),name(name_), strBuf_(cout.rdbuf()) {} 15 CLog(const string& name_, std::streambuf* sBuff = cout.rdbuf()) 16 : ostream(sBuff), level(0), name(name_), strBuf_(sBuff) {} 16 17 CLog& operator()(int l) 17 18 { … … 30 31 31 32 public: 32 //! Write infointo a file with its streambuf33 //! Write log into a file with its streambuf 33 34 void write2File(std::streambuf* sBuff) { changeStreamBuff(sBuff); } 34 35 35 //! Write infointo standard output36 //! Write log into standard output 36 37 void write2StdOut() { changeStreamBuff(cout.rdbuf()); } 38 39 //! Write log into standard error output 40 void write2StdErr() { changeStreamBuff(cerr.rdbuf()); } 41 37 42 private: 38 43 /*! … … 43 48 void changeStreamBuff(std::streambuf* sBuff) { strBuf_ = sBuff; rdbuf(sBuff); } 44 49 45 private :46 50 int level ; 47 51 string name ; … … 51 55 extern CLog info; 52 56 extern CLog report; 57 extern CLog error; 53 58 } 54 59 #endif
Note: See TracChangeset
for help on using the changeset viewer.