Last change
on this file since 871 was 717, checked in by mar637, 19 years ago |
implemented use of SDLog
|
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
483 bytes
|
Rev | Line | |
---|
[717] | 1 | #include "SDLog.h"
|
---|
| 2 |
|
---|
| 3 | using namespace asap;
|
---|
| 4 |
|
---|
| 5 | std::string SDLog::log_ = std::string("");
|
---|
| 6 |
|
---|
| 7 | SDLog::SDLog()
|
---|
| 8 | {
|
---|
| 9 | enableLog();
|
---|
| 10 | }
|
---|
| 11 |
|
---|
| 12 | SDLog::SDLog(bool enabled)
|
---|
| 13 | {
|
---|
| 14 | enabled_ = enabled;
|
---|
| 15 | }
|
---|
| 16 |
|
---|
| 17 | void SDLog::pushLog(const std::string& s) const
|
---|
| 18 | {
|
---|
| 19 | if (enabled_) {
|
---|
| 20 | log_+=s;log_+="\n";
|
---|
| 21 | };
|
---|
| 22 | }
|
---|
| 23 | std::string SDLog::popLog() const
|
---|
| 24 | {
|
---|
| 25 | std::string out;
|
---|
| 26 | if (enabled_) out=log_;log_="";
|
---|
| 27 | return out;
|
---|
| 28 | }
|
---|
| 29 | void SDLog::enableLog()
|
---|
| 30 | {
|
---|
| 31 | enabled_ = true;
|
---|
| 32 | }
|
---|
| 33 | void SDLog::disableLog()
|
---|
| 34 | {
|
---|
| 35 | enabled_ = false;
|
---|
| 36 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.