source: trunk/src/Logger.cpp@ 945

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