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
RevLine 
[717]1#include "SDLog.h"
2
3using namespace asap;
4
5std::string SDLog::log_ = std::string("");
6
[883]7SDLog::SDLog()
8{
[717]9 enableLog();
10}
11
12SDLog::SDLog(bool enabled)
[883]13{
[717]14 enabled_ = enabled;
15}
16
[883]17void SDLog::pushLog(const std::string& s, bool newline ) const
18{
[717]19 if (enabled_) {
[883]20 log_+=s;
21 if ( newline ) log_+="\n";
22 };
[717]23}
24std::string SDLog::popLog() const
25{
[883]26 std::string out;
[717]27 if (enabled_) out=log_;log_="";
28 return out;
29}
30void SDLog::enableLog()
[883]31{
[717]32 enabled_ = true;
33}
34void SDLog::disableLog()
35{
36 enabled_ = false;
37}
Note: See TracBrowser for help on using the repository browser.