Changeset 883
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDLog.cc
r717 r883 5 5 std::string SDLog::log_ = std::string(""); 6 6 7 SDLog::SDLog() 8 { 7 SDLog::SDLog() 8 { 9 9 enableLog(); 10 10 } 11 11 12 12 SDLog::SDLog(bool enabled) 13 { 13 { 14 14 enabled_ = enabled; 15 15 } 16 16 17 void SDLog::pushLog(const std::string& s ) const18 { 17 void SDLog::pushLog(const std::string& s, bool newline ) const 18 { 19 19 if (enabled_) { 20 log_+=s;log_+="\n"; 21 }; 20 log_+=s; 21 if ( newline ) log_+="\n"; 22 }; 22 23 } 23 24 std::string SDLog::popLog() const 24 25 { 25 std::string out; 26 std::string out; 26 27 if (enabled_) out=log_;log_=""; 27 28 return out; 28 29 } 29 30 void SDLog::enableLog() 30 { 31 { 31 32 enabled_ = true; 32 33 } -
trunk/src/SDLog.h
r717 r883 11 11 SDLog(); 12 12 SDLog(bool enabled); 13 void pushLog(const std::string& s ) const;13 void pushLog(const std::string& s, bool newline=true) const; 14 14 //void pushLog(const char* cs); 15 15 std::string popLog() const;
Note:
See TracChangeset
for help on using the changeset viewer.