NullChannel.h 1.2 KB

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