class Poco::LoggingRegistry

Overview

A registry for channels and formatters. Moreā€¦

#include <LoggingRegistry.h>

class LoggingRegistry
{
public:
    // methods

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

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

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

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

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

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

    void
    clear();

    static
    LoggingRegistry&
    defaultRegistry();
};

Detailed Documentation

A registry for channels and formatters.

The LoggingRegistry class is used for configuring the logging framework.

Construction

~LoggingRegistry()

Destroys the LoggingRegistry.

Methods

Channel*
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.

Formatter*
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.

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

Registers a channel under a given name.

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

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

Registers a formatter under a given name.

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

void
unregisterChannel(const std::string& name)

Unregisters the given channel.

Throws a NotFoundException if the name is unknown.

void
unregisterFormatter(const std::string& name)

Unregisters the given formatter.

Throws a NotFoundException if the name is unknown.

void
clear()

Unregisters all registered channels and formatters.

static
LoggingRegistry&
defaultRegistry()

Returns a reference to the default LoggingRegistry.