Last change
on this file since 1104 was
1104,
checked in by mar637, 18 years ago
|
added doxygen documentation
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
1.1 KB
|
Rev | Line | |
---|
[1102] | 1 | #ifndef ASAPLOGGER_H |
---|
| 2 | #define ASAPLOGGER_H |
---|
[717] | 3 | |
---|
| 4 | #include <string> |
---|
| 5 | #include <iostream> |
---|
| 6 | |
---|
| 7 | namespace asap { |
---|
[1102] | 8 | /** |
---|
| 9 | * This class provides the logging within asap. All other classes which need to log |
---|
| 10 | * should inherit from this. |
---|
| 11 | * @brief The ASAP logging class |
---|
| 12 | * @author Malte Marquarding |
---|
| 13 | * @date $Date: 2006-08-02 04:58:50 +0000 (Wed, 02 Aug 2006) $ |
---|
| 14 | * @version |
---|
| 15 | */ |
---|
[890] | 16 | class Logger { |
---|
[717] | 17 | public: |
---|
[1102] | 18 | /** |
---|
| 19 | * Default Constructor |
---|
| 20 | **/ |
---|
[890] | 21 | Logger(); |
---|
[1102] | 22 | |
---|
| 23 | /** |
---|
| 24 | * Constructor with switch to enable/disable logging |
---|
| 25 | * @param[in] enabled indicating the deafult state |
---|
| 26 | */ |
---|
| 27 | Logger(bool enabled); |
---|
| 28 | |
---|
| 29 | /* |
---|
| 30 | * Destructor |
---|
| 31 | */ |
---|
[1030] | 32 | virtual ~Logger(); |
---|
[1102] | 33 | /** |
---|
| 34 | * push another message into the logger |
---|
[1104] | 35 | * @param[in] s the message |
---|
| 36 | * @param[in] newline whether to add a newline character at the end |
---|
[1102] | 37 | */ |
---|
[883] | 38 | void pushLog(const std::string& s, bool newline=true) const; |
---|
[1102] | 39 | /** |
---|
| 40 | * pop the message form the logger |
---|
[1104] | 41 | * @return the log message string |
---|
[1102] | 42 | */ |
---|
[717] | 43 | std::string popLog() const; |
---|
[1102] | 44 | /** |
---|
| 45 | * enable logging |
---|
| 46 | */ |
---|
[717] | 47 | virtual void enableLog(); |
---|
[1102] | 48 | /** |
---|
| 49 | * disable logging |
---|
| 50 | */ |
---|
[717] | 51 | virtual void disableLog(); |
---|
[1102] | 52 | |
---|
[717] | 53 | private: |
---|
| 54 | static std::string log_; |
---|
| 55 | bool enabled_; |
---|
| 56 | }; |
---|
| 57 | |
---|
[1102] | 58 | } // namespace |
---|
[717] | 59 | |
---|
| 60 | #endif |
---|
| 61 | |
---|
Note: See
TracBrowser
for help on using the repository browser.