Apache log4cxx  Version 0.12.1
loggerrepository.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _LOG4CXX_SPI_LOG_REPOSITORY_H
19 #define _LOG4CXX_SPI_LOG_REPOSITORY_H
20 
21 #if defined(_MSC_VER)
22  #pragma warning ( push )
23  #pragma warning ( disable: 4231 4251 4275 4786 )
24 #endif
25 
26 
27 #include <log4cxx/appender.h>
29 #include <log4cxx/level.h>
31 
32 namespace log4cxx
33 {
34 namespace spi
35 {
36 
47 class LOG4CXX_EXPORT LoggerRepository : public virtual helpers::Object
48 {
49  public:
51  virtual ~LoggerRepository() {}
52 
57  virtual void addHierarchyEventListener(const HierarchyEventListenerPtr&
58  listener) = 0;
63  virtual bool isDisabled(int level) const = 0;
64 
69  virtual void setThreshold(const LevelPtr& level) = 0;
70 
75  virtual void setThreshold(const LogString& val) = 0;
76 
77  virtual void emitNoAppenderWarning(const Logger* logger) = 0;
78 
83  virtual const LevelPtr& getThreshold() const = 0;
84 
85  virtual LoggerPtr getLogger(const LogString& name) = 0;
86 
87  virtual LoggerPtr getLogger(const LogString& name,
88  const spi::LoggerFactoryPtr& factory) = 0;
89 
90  virtual LoggerPtr getRootLogger() const = 0;
91 
92  virtual LoggerPtr exists(const LogString& name) = 0;
93 
94  virtual void shutdown() = 0;
95 
96  virtual LoggerList getCurrentLoggers() const = 0;
97 
98  virtual void fireAddAppenderEvent(const Logger* logger,
99  const Appender* appender) = 0;
100 
101  virtual void resetConfiguration() = 0;
102 
103  virtual bool isConfigured() = 0;
104  virtual void setConfigured(bool configured) = 0;
105 
106 }; // class LoggerRepository
107 
108 } // namespace spi
109 } // namespace log4cxx
110 
111 #if defined(_MSC_VER)
112  #pragma warning ( pop )
113 #endif
114 
115 
116 #endif //_LOG4CXX_SPI_LOG_REPOSITORY_H
A LoggerRepository is used to create and retrieve Loggers.
Definition: loggerrepository.h:47
#define DECLARE_ABSTRACT_LOG4CXX_OBJECT(object)
Definition: object.h:26
std::shared_ptr< LoggerFactory > LoggerFactoryPtr
Definition: logmanager.h:38
std::shared_ptr< Level > LevelPtr
Definition: optionconverter.h:27
std::vector< LoggerPtr > LoggerList
Definition: logmanager.h:34
base class for java-like objects.
Definition: object.h:101
Implement this interface for your own strategies for outputting log statements.
Definition: appender.h:55
This is the central class in the log4cxx package.
Definition: logger.h:63
std::shared_ptr< Logger > LoggerPtr
Definition: defaultloggerfactory.h:26
Definition: appender.h:32
std::basic_string< logchar > LogString
Definition: logstring.h:66