1 | // |
2 | // NullChannel.h |
3 | // |
4 | // Library: Foundation |
5 | // Package: Logging |
6 | // Module: NullChannel |
7 | // |
8 | // Definition of the NullChannel class. |
9 | // |
10 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. |
11 | // and Contributors. |
12 | // |
13 | // SPDX-License-Identifier: BSL-1.0 |
14 | // |
15 | |
16 | |
17 | #ifndef Foundation_NullChannel_INCLUDED |
18 | #define Foundation_NullChannel_INCLUDED |
19 | |
20 | |
21 | #include "Poco/Foundation.h" |
22 | #include "Poco/Channel.h" |
23 | |
24 | |
25 | namespace Poco { |
26 | |
27 | |
28 | class Foundation_API NullChannel: public Channel |
29 | /// The NullChannel is the /dev/null of Channels. |
30 | /// |
31 | /// A NullChannel discards all information sent to it. |
32 | /// Furthermore, its setProperty() method ignores |
33 | /// all properties, so it the NullChannel has the |
34 | /// nice feature that it can stand in for any |
35 | /// other channel class in a logging configuration. |
36 | { |
37 | public: |
38 | NullChannel(); |
39 | /// Creates the NullChannel. |
40 | |
41 | ~NullChannel(); |
42 | /// Destroys the NullChannel. |
43 | |
44 | void log(const Message& msg); |
45 | /// Does nothing. |
46 | |
47 | void setProperty(const std::string& name, const std::string& value); |
48 | /// Ignores both name and value. |
49 | }; |
50 | |
51 | |
52 | } // namespace Poco |
53 | |
54 | |
55 | #endif // Foundation_NullChannel_INCLUDED |
56 | |