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_BASIC_CONFIGURATOR_H
|
---|
19 | #define _LOG4CXX_BASIC_CONFIGURATOR_H
|
---|
20 |
|
---|
21 | #include <log4cxx/helpers/objectptr.h>
|
---|
22 | #include <log4cxx/helpers/objectimpl.h>
|
---|
23 | #include <log4cxx/logger.h>
|
---|
24 | #include <log4cxx/logstring.h>
|
---|
25 | #include <log4cxx/spi/configurator.h>
|
---|
26 |
|
---|
27 | namespace log4cxx
|
---|
28 | {
|
---|
29 | class Appender;
|
---|
30 | typedef helpers::ObjectPtrT<Appender> AppenderPtr;
|
---|
31 |
|
---|
32 | /**
|
---|
33 | Use this class to quickly configure the package.
|
---|
34 | <p>For file based configuration see
|
---|
35 | PropertyConfigurator. For XML based configuration see
|
---|
36 | DOMConfigurator.
|
---|
37 | */
|
---|
38 | class LOG4CXX_EXPORT BasicConfigurator
|
---|
39 | {
|
---|
40 | protected:
|
---|
41 | BasicConfigurator() {}
|
---|
42 |
|
---|
43 | public:
|
---|
44 | /**
|
---|
45 | Add a ConsoleAppender that uses PatternLayout
|
---|
46 | using the PatternLayout#TTCC_CONVERSION_PATTERN and
|
---|
47 | prints to <code>stdout</code> to the root logger.*/
|
---|
48 | static void configure();
|
---|
49 |
|
---|
50 | /**
|
---|
51 | Add <code>appender</code> to the root logger.
|
---|
52 | @param appender The appender to add to the root logger.
|
---|
53 | */
|
---|
54 | static void configure(const AppenderPtr& appender);
|
---|
55 |
|
---|
56 | /**
|
---|
57 | Reset the default hierarchy to its defaut. It is equivalent to
|
---|
58 | calling
|
---|
59 | <code>Logger::getDefaultHierarchy()->resetConfiguration()</code>.
|
---|
60 | See Hierarchy#resetConfiguration() for more details. */
|
---|
61 | static void resetConfiguration();
|
---|
62 | }; // class BasicConfigurator
|
---|
63 | } // namespace log4cxx
|
---|
64 |
|
---|
65 | #endif //_LOG4CXX_BASIC_CONFIGURATOR_H
|
---|