class Poco::ConsoleChannel

Overview

A channel that writes to an ostream. More…

#include <ConsoleChannel.h>

class ConsoleChannel: public Poco::Channel
{
public:
    // construction

    ConsoleChannel();
    ConsoleChannel(std::ostream& str);

    // methods

    virtual
    void
    log(const Message& msg);
};

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;

    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;

Detailed Documentation

A channel that writes to an ostream.

Only the message’s text is written, followed by a newline.

Chain this channel to a FormattingChannel with an appropriate Formatter to control what is contained in the text.

Similar to StreamChannel, except that a static mutex is used to protect against multiple console channels concurrently writing to the same stream.

Construction

ConsoleChannel()

Creates the channel and attaches std::clog.

ConsoleChannel(std::ostream& str)

Creates the channel using the given stream.

Methods

virtual
void
log(const Message& msg)

Logs the given message to the channel’s stream.