Poco

class LoggingRegistry

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

Description

A registry for channels and formatters.

The LoggingRegistry class is used for configuring the logging framework.

Member Summary

Member Functions: channelForName, clear, defaultRegistry, formatterForName, registerChannel, registerFormatter, unregisterChannel, unregisterFormatter

Constructors

LoggingRegistry

LoggingRegistry();

Creates the LoggingRegistry.

Destructor

~LoggingRegistry

~LoggingRegistry();

Destroys the LoggingRegistry.

Member Functions

channelForName

Channel::Ptr channelForName(
    const std::string & name
) const;

Returns the Channel object which has been registered under the given name.

Throws a NotFoundException if the name is unknown.

clear

void clear();

Unregisters all registered channels and formatters.

defaultRegistry static

static LoggingRegistry & defaultRegistry();

Returns a reference to the default LoggingRegistry.

formatterForName

Formatter::Ptr formatterForName(
    const std::string & name
) const;

Returns the Formatter object which has been registered under the given name.

Throws a NotFoundException if the name is unknown.

registerChannel

void registerChannel(
    const std::string & name,
    Channel::Ptr pChannel
);

Registers a channel under a given name. It is okay to re-register a different channel under an already existing name.

registerFormatter

void registerFormatter(
    const std::string & name,
    Formatter::Ptr pFormatter
);

Registers a formatter under a given name. It is okay to re-register a different formatter under an already existing name.

unregisterChannel

void unregisterChannel(
    const std::string & name
);

Unregisters the given channel.

Throws a NotFoundException if the name is unknown.

unregisterFormatter

void unregisterFormatter(
    const std::string & name
);

Unregisters the given formatter.

Throws a NotFoundException if the name is unknown.