source: trunk/src/Logger.cpp@ 2262

Last change on this file since 2262 was 1030, checked in by mar637, 19 years ago

Various fixes to make >=gcc-3.4 compliant

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 543 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}
[1030]16Logger::~Logger()
17{
18}
[717]19
[890]20void Logger::pushLog(const std::string& s, bool newline ) const
[883]21{
[717]22 if (enabled_) {
[883]23 log_+=s;
24 if ( newline ) log_+="\n";
25 };
[717]26}
[890]27std::string Logger::popLog() const
[717]28{
[883]29 std::string out;
[717]30 if (enabled_) out=log_;log_="";
31 return out;
32}
[890]33void Logger::enableLog()
[883]34{
[717]35 enabled_ = true;
36}
[890]37void Logger::disableLog()
[717]38{
39 enabled_ = false;
40}
Note: See TracBrowser for help on using the repository browser.