source: trunk/src/SDLog.cc@ 884

Last change on this file since 884 was 883, checked in by mar637, 19 years ago

added toggle for newline at end of each push

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 511 bytes
Line 
1#include "SDLog.h"
2
3using namespace asap;
4
5std::string SDLog::log_ = std::string("");
6
7SDLog::SDLog()
8{
9 enableLog();
10}
11
12SDLog::SDLog(bool enabled)
13{
14 enabled_ = enabled;
15}
16
17void SDLog::pushLog(const std::string& s, bool newline ) const
18{
19 if (enabled_) {
20 log_+=s;
21 if ( newline ) log_+="\n";
22 };
23}
24std::string SDLog::popLog() const
25{
26 std::string out;
27 if (enabled_) out=log_;log_="";
28 return out;
29}
30void SDLog::enableLog()
31{
32 enabled_ = true;
33}
34void SDLog::disableLog()
35{
36 enabled_ = false;
37}
Note: See TracBrowser for help on using the repository browser.