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