class Poco::Channel

Overview

The base class for all Channel classes. Moreā€¦

#include <Channel.h>

class Channel:
    public Poco::Configurable,
    public Poco::RefCountedObject
{
public:
    // methods

    virtual
    void
    open();

    virtual
    void
    close();

    virtual
    void
    log(const Message& msg) = 0;

    virtual
    void
    setProperty(
        const std::string& name,
        const std::string& value
        );

    virtual
    std::string
    getProperty(const std::string& name) const;
};

// direct descendants

class AsyncChannel;
class ColorConsoleChannel;
class ConsoleChannel;
class EventChannel;
class EventLogChannel;
class FileChannel;
class FormattingChannel;
class Logger;
class RemoteSyslogChannel;
class SMTPChannel;
class NullChannel;
class OpcomChannel;
class SimpleFileChannel;
class SplitterChannel;
class StreamChannel;
class SyslogChannel;
class WindowsColorConsoleChannel;
class WindowsConsoleChannel;

Inherited Members

public:
    // methods

    virtual
    void
    setProperty(
        const std::string& name,
        const std::string& value
        ) = 0;

    virtual
    std::string
    getProperty(const std::string& name) const = 0;

    void
    duplicate() const;

    void
    release() const;

    int
    referenceCount() const;

Detailed Documentation

The base class for all Channel classes.

Supports reference counting based garbage collection and provides trivial implementations of getProperty() and setProperty().

Methods

virtual
void
open()

Does whatever is necessary to open the channel.

The default implementation does nothing.

virtual
void
close()

Does whatever is necessary to close the channel.

The default implementation does nothing.

virtual
void
log(const Message& msg) = 0

Logs the given message to the channel.

Must be overridden by subclasses.

If the channel has not been opened yet, the log() method will open it.

virtual
void
setProperty(
    const std::string& name,
    const std::string& value
    )

Throws a PropertyNotSupportedException.

virtual
std::string
getProperty(const std::string& name) const

Throws a PropertyNotSupportedException.