NullChannel.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #ifndef Foundation_NullChannel_INCLUDED
  16. #define Foundation_NullChannel_INCLUDED
  17. #include "Poco/Foundation.h"
  18. #include "Poco/Channel.h"
  19. namespace Poco {
  20. class Foundation_API NullChannel: public Channel
  21. /// The NullChannel is the /dev/null of Channels.
  22. ///
  23. /// A NullChannel discards all information sent to it.
  24. /// Furthermore, its setProperty() method ignores
  25. /// all properties, so it the NullChannel has the
  26. /// nice feature that it can stand in for any
  27. /// other channel class in a logging configuration.
  28. {
  29. public:
  30. NullChannel();
  31. /// Creates the NullChannel.
  32. ~NullChannel();
  33. /// Destroys the NullChannel.
  34. void log(const Message& msg);
  35. /// Does nothing.
  36. void setProperty(const std::string& name, const std::string& value);
  37. /// Ignores both name and value.
  38. };
  39. } // namespace Poco
  40. #endif // Foundation_NullChannel_INCLUDED