source:
branches/Release2.1.1/src/Logger.h@
2100
Last change on this file since 2100 was 1106, checked in by , 18 years ago | |
---|---|
|
|
File size: 1.3 KB |
Line | |
---|---|
1 | // |
2 | // C++ Interface: Logger |
3 | // |
4 | // Description: |
5 | // |
6 | // |
7 | // Author: Malte Marquarding <asap@atnf.csiro.au>, (C) 2005 |
8 | // |
9 | // Copyright: See COPYING file that comes with this distribution |
10 | // |
11 | // |
12 | #ifndef ASAPLOGGER_H |
13 | #define ASAPLOGGER_H |
14 | |
15 | #include <string> |
16 | #include <iostream> |
17 | |
18 | namespace asap { |
19 | /** |
20 | * This class provides the logging within asap. All other classes which need to log |
21 | * should inherit from this. |
22 | * @brief The ASAP logging class |
23 | * @author Malte Marquarding |
24 | * @date $Date: 2006-08-03 00:28:39 +0000 (Thu, 03 Aug 2006) $ |
25 | * @version |
26 | */ |
27 | class Logger { |
28 | public: |
29 | /** |
30 | * Default Constructor |
31 | **/ |
32 | Logger(); |
33 | |
34 | /** |
35 | * Constructor with switch to enable/disable logging |
36 | * @param[in] enabled indicating the deafult state |
37 | */ |
38 | Logger(bool enabled); |
39 | |
40 | /* |
41 | * Destructor |
42 | */ |
43 | virtual ~Logger(); |
44 | /** |
45 | * push another message into the logger |
46 | * @param[in] s the message |
47 | * @param[in] newline whether to add a newline character at the end |
48 | */ |
49 | void pushLog(const std::string& s, bool newline=true) const; |
50 | /** |
51 | * pop the message form the logger |
52 | * @return the log message string |
53 | */ |
54 | std::string popLog() const; |
55 | /** |
56 | * enable logging |
57 | */ |
58 | virtual void enableLog(); |
59 | /** |
60 | * disable logging |
61 | */ |
62 | virtual void disableLog(); |
63 | |
64 | private: |
65 | static std::string log_; |
66 | bool enabled_; |
67 | }; |
68 | |
69 | } // namespace |
70 | |
71 | #endif |
72 |
Note:
See TracBrowser
for help on using the repository browser.