18#ifndef _LOG4CXX_HIERARCHY_H
19#define _LOG4CXX_HIERARCHY_H
54 LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(HierarchyPrivate, m_priv)
128 const spi::LoggerFactoryPtr& factory = {})
override;
178 void setThresholdInternal(
const LevelPtr& l);
183 void shutdownInternal();
221 Hierarchy(
const Hierarchy&);
222 Hierarchy& operator=(
const Hierarchy&);
Implement this interface for your own strategies for outputting log statements.
Definition appender.h:51
This class is specialized in retrieving loggers by name and also maintaining the logger hierarchy.
Definition hierarchy.h:52
void ensureIsConfigured(std::function< void()> configurator) override
Call configurator if not yet configured and configurator has not already been tried....
bool removeLogger(const LogString &name, bool ifNotUsed=true) override
Remove the name Logger from the repository.Note: The name Logger must be retrieved from the repositor...
LoggerList getCurrentLoggers() const override
All the loggers currently defined in this repository.The root logger is not included in the returned ...
void emitNoAppenderWarning(const Logger *logger) override
Add a warning to internal debug output that logger does not have any Appender attached.
LoggerPtr getRootLogger() const override
The logger that cannot be retrieved by name.
void resetConfiguration() override
Reset all values contained in this repository instance to their default.This removes all appenders fr...
LevelPtr getThreshold() const override
The current repository-wide threshold.See setThreshold for an explanation.
LoggerPtr exists(const LogString &name) override
Does name exist in the repository?The Logger instance if name exists in the repository.
void removeHierarchyEventListener(const spi::HierarchyEventListenerPtr &listener) override
Remove listener from the repository.
void setThreshold(const LevelPtr &newLevel) override
Enable logging for logging requests with level newLevel or higher.All logging requests below the thre...
virtual void setConfigured(bool configured) override
Set the configured status to true.
void fireAddAppenderEvent(const Logger *logger, const Appender *appender) override
Call addAppenderEvent on all registered listeners.
void updateChildren(const Logger *parent) override
Refresh the configuration of all loggers where parent is somewhere in their ancestor chain....
static HierarchyPtr create()
Create a new logger hierarchy.
bool isDisabled(int level) const override
Is the repository disabled for level?The answer depends on the repository threshold and the level par...
virtual bool isConfigured() override
The value of the configured status.
void addHierarchyEventListener(const spi::HierarchyEventListenerPtr &listener) override
LoggerPtr getLogger(const LogString &name, const spi::LoggerFactoryPtr &factory={}) override
Retrieve the name Logger instance.If a logger of that name already exists, it will be returned....
void clear()
This call will clear all logger definitions from the internal hashtable.
void setThreshold(const LogString &levelStr) override
Enable logging for logging requests with level newLevel or higher.The threshold is set the DEBUG if n...
void fireRemoveAppenderEvent(const Logger *logger, const Appender *appender) override
Call removeAppenderEvent on all registered listeners.
void shutdown() override
Shutting down a hierarchy will safely close and remove all appenders in all categories including the ...
This is the central class in the log4cxx package.
Definition log4cxx/logger.h:52
A LoggerRepository is used to create and retrieve Loggers.
Definition loggerrepository.h:43
std::vector< LoggerPtr > ProvisionNode
Definition provisionnode.h:31
std::basic_string< logchar > LogString
Definition logstring.h:51
std::shared_ptr< Level > LevelPtr
Definition optionconverter.h:28
LOG4CXX_PTR_DEF(Appender)
std::shared_ptr< Logger > LoggerPtr
Definition provisionnode.h:28
#define LOG4CXX_CAST_ENTRY(Interface)
Definition object.h:153
#define DECLARE_ABSTRACT_LOG4CXX_OBJECT(object)
Definition object.h:37
#define END_LOG4CXX_CAST_MAP()
Definition object.h:147
#define LOG4CXX_CAST_ENTRY_CHAIN(Interface)
Definition object.h:159
#define BEGIN_LOG4CXX_CAST_MAP()
Definition object.h:141