source: trunk/src/Logger.cpp@ 1028

Last change on this file since 1028 was 894, checked in by mar637, 19 years ago

asap2 naming changes

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