Last change
on this file since 3037 was 1859, checked in by Malte Marquarding, 14 years ago |
Ticket #193: the rcParamsverbose flag is only used in standard asap cli mode. Otherwise log messages are always send to the logger and one needs to call asaplog.disable()/asaplog.enable() to controls this. I have also added the function name as the log origin.
|
File size:
1.1 KB
|
Rev | Line | |
---|
[1797] | 1 | //
|
---|
| 2 | // C++ Interface: AsapLogSink
|
---|
| 3 | //
|
---|
| 4 | // Description:
|
---|
| 5 | //
|
---|
| 6 | //
|
---|
| 7 | // Author: Malte Marquarding <asap@atnf.csiro.au>, (C) 2010
|
---|
| 8 | //
|
---|
| 9 | // Copyright: See COPYING file that comes with this distribution
|
---|
| 10 | //
|
---|
| 11 | //
|
---|
| 12 | #ifndef ASAPLOGSINK_H
|
---|
| 13 | #define ASAPLOGSINK_H
|
---|
| 14 |
|
---|
| 15 | #include <casa/Logging/MemoryLogSink.h>
|
---|
| 16 | #include <string>
|
---|
| 17 |
|
---|
| 18 | namespace asap {
|
---|
| 19 | /**
|
---|
| 20 | * This class provides the a casa::LogSink implementation for asap
|
---|
| 21 | * It should be used to catch all casa logMessage and replace the globalSink.
|
---|
| 22 | * It provides an overloaded postLocally which accepts strings so it can also
|
---|
| 23 | * be used from python.
|
---|
| 24 | * @brief The ASAP logging class
|
---|
| 25 | * @author Malte Marquarding
|
---|
| 26 | * @date $Date: $
|
---|
| 27 | * @version
|
---|
| 28 | */
|
---|
| 29 | class AsapLogSink : public casa::MemoryLogSink {
|
---|
| 30 | public:
|
---|
| 31 | /**
|
---|
| 32 | * Default Constructor
|
---|
| 33 | **/
|
---|
| 34 | AsapLogSink() {;} ;
|
---|
| 35 |
|
---|
| 36 | virtual ~AsapLogSink() {;};
|
---|
| 37 |
|
---|
| 38 | virtual void postMessage(const std::string& msg,
|
---|
[1859] | 39 | const std::string& priority="INFO",
|
---|
| 40 | const std::string& origin="");
|
---|
[1797] | 41 |
|
---|
| 42 | std::string popMessages();
|
---|
| 43 |
|
---|
| 44 | private:
|
---|
| 45 |
|
---|
| 46 | };
|
---|
| 47 |
|
---|
| 48 | void setAsapSink(AsapLogSink& sink);
|
---|
| 49 |
|
---|
| 50 | } // namespace
|
---|
| 51 |
|
---|
| 52 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.