18 #ifndef _LOG4CXX_HIERARCHY_H
19 #define _LOG4CXX_HIERARCHY_H
22 #pragma warning (push)
23 #pragma warning ( disable: 4231 4251 4275 4786 )
62 public std::enable_shared_from_this<Hierarchy>
66 mutable std::mutex mutex;
70 spi::HierarchyEventListenerList listeners;
72 typedef std::map<LogString, LoggerPtr> LoggerMap;
73 std::unique_ptr<LoggerMap> loggers;
75 typedef std::map<LogString, ProvisionNode> ProvisionNodeMap;
76 std::unique_ptr<ProvisionNodeMap> provisionNodes;
83 bool emittedNoAppenderWarning;
84 bool emittedNoResourceBundleWarning;
243 void setThresholdInternal(
const LevelPtr& l);
248 void shutdownInternal();
296 #if defined(_MSC_VER)
297 #pragma warning (pop)
Implement this interface for your own strategies for outputting log statements.
Definition: appender.h:57
This class is specialized in retrieving loggers by name and also maintaining the logger hierarchy.
Definition: hierarchy.h:63
LoggerPtr exists(const LogString &name)
Check if the named logger exists in the hierarchy.
bool isDisabled(int level) const
This method will return true if this repository is disabled for level object passed as parameter and ...
void resetConfiguration()
Reset all values contained in this hierarchy instance to their default.
virtual void setConfigured(bool configured)
void addHierarchyEventListener(const spi::HierarchyEventListenerPtr &listener)
void fireAddAppenderEvent(const Logger *logger, const Appender *appender)
void emitNoAppenderWarning(const Logger *logger)
LoggerPtr getLogger(const LogString &name, const spi::LoggerFactoryPtr &factory)
Return a new logger instance named as the first parameter using factory.
LoggerList getCurrentLoggers() const
Returns all the currently defined loggers in this hierarchy as a LoggerList.
LoggerPtr getRootLogger() const
Get the root of this hierarchy.
static HierarchyPtr create()
void setThreshold(const LevelPtr &l)
Enable logging for logging requests with level l or higher.
void shutdown()
Used by subclasses to add a renderer to the hierarchy passed as parameter.
void setThreshold(const LogString &levelStr)
The string form of setThreshold.
virtual bool isConfigured()
LoggerPtr getLogger(const LogString &name)
Return a new logger instance named as the first parameter using the default factory.
void fireRemoveAppenderEvent(const Logger *logger, const Appender *appender)
void clear()
This call will clear all logger definitions from the internal hashtable.
const LevelPtr & getThreshold() const
Returns a Level representation of the enable state.
This is the central class in the log4cxx package.
Definition: logger.h:66
base class for java-like objects.
Definition: object.h:102
A LoggerRepository is used to create and retrieve Loggers.
Definition: loggerrepository.h:48
std::shared_ptr< LoggerFactory > LoggerFactoryPtr
Definition: logmanager.h:38
Definition: appender.h:33
std::vector< LoggerPtr > ProvisionNode
Definition: provisionnode.h:31
std::basic_string< logchar > LogString
Definition: logstring.h:66
std::shared_ptr< Level > LevelPtr
Definition: optionconverter.h:27
LOG4CXX_PTR_DEF(Appender)
std::shared_ptr< Logger > LoggerPtr
Definition: defaultloggerfactory.h:26
std::vector< LoggerPtr > LoggerList
Definition: logmanager.h:34
#define LOG4CXX_CAST_ENTRY(Interface)
Definition: object.h:153
#define DECLARE_ABSTRACT_LOG4CXX_OBJECT(object)
Definition: object.h:26
#define END_LOG4CXX_CAST_MAP()
Definition: object.h:147
#define BEGIN_LOG4CXX_CAST_MAP()
Definition: object.h:141