2012-04-29 20:52:25 +02:00
|
|
|
//
|
|
|
|
// NullChannel.h
|
|
|
|
//
|
|
|
|
// Library: Foundation
|
|
|
|
// Package: Logging
|
|
|
|
// Module: NullChannel
|
|
|
|
//
|
|
|
|
// Definition of the NullChannel class.
|
|
|
|
//
|
|
|
|
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
|
|
|
// and Contributors.
|
|
|
|
//
|
2014-05-04 21:02:42 +02:00
|
|
|
// SPDX-License-Identifier: BSL-1.0
|
2012-04-29 20:52:25 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef Foundation_NullChannel_INCLUDED
|
|
|
|
#define Foundation_NullChannel_INCLUDED
|
|
|
|
|
|
|
|
|
|
|
|
#include "Poco/Foundation.h"
|
|
|
|
#include "Poco/Channel.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace Poco {
|
|
|
|
|
|
|
|
|
|
|
|
class Foundation_API NullChannel: public Channel
|
|
|
|
/// The NullChannel is the /dev/null of Channels.
|
|
|
|
///
|
|
|
|
/// A NullChannel discards all information sent to it.
|
|
|
|
/// Furthermore, its setProperty() method ignores
|
|
|
|
/// all properties, so it the NullChannel has the
|
|
|
|
/// nice feature that it can stand in for any
|
|
|
|
/// other channel class in a logging configuration.
|
|
|
|
{
|
|
|
|
public:
|
2020-01-09 10:08:09 +01:00
|
|
|
using Ptr = AutoPtr<NullChannel>;
|
|
|
|
|
2012-04-29 20:52:25 +02:00
|
|
|
NullChannel();
|
|
|
|
/// Creates the NullChannel.
|
|
|
|
|
|
|
|
~NullChannel();
|
|
|
|
/// Destroys the NullChannel.
|
|
|
|
|
|
|
|
void log(const Message& msg);
|
|
|
|
/// Does nothing.
|
|
|
|
|
|
|
|
void setProperty(const std::string& name, const std::string& value);
|
|
|
|
/// Ignores both name and value.
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace Poco
|
|
|
|
|
|
|
|
|
|
|
|
#endif // Foundation_NullChannel_INCLUDED
|