Poco

class ConsoleChannel

File Information

Library: Foundation
Package: Logging
Header: Poco/ConsoleChannel.h

Description

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.

Inheritance

Direct Base Classes: Channel

All Base Classes: Channel, Configurable, RefCountedObject

Member Summary

Member Functions: log

Inherited Functions: close, duplicate, getProperty, log, open, referenceCount, release, setProperty

Types Aliases

Ptr

using Ptr = AutoPtr < ConsoleChannel >;

Constructors

ConsoleChannel

ConsoleChannel();

Creates the channel and attaches std::clog.

ConsoleChannel

ConsoleChannel(
    std::ostream & str
);

Creates the channel using the given stream.

Destructor

~ConsoleChannel protected virtual

~ConsoleChannel();

Member Functions

log virtual

void log(
    const Message & msg
);

Logs the given message to the channel's stream.