/src/log4cplus/src/rootlogger.cxx
Line | Count | Source |
1 | | // Module: Log4CPLUS |
2 | | // File: rootlogger.cxx |
3 | | // Created: 4/2003 |
4 | | // Author: Tad E. Smith |
5 | | // |
6 | | // |
7 | | // Copyright 2003-2017 Tad E. Smith |
8 | | // |
9 | | // Licensed under the Apache License, Version 2.0 (the "License"); |
10 | | // you may not use this file except in compliance with the License. |
11 | | // You may obtain a copy of the License at |
12 | | // |
13 | | // http://www.apache.org/licenses/LICENSE-2.0 |
14 | | // |
15 | | // Unless required by applicable law or agreed to in writing, software |
16 | | // distributed under the License is distributed on an "AS IS" BASIS, |
17 | | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
18 | | // See the License for the specific language governing permissions and |
19 | | // limitations under the License. |
20 | | |
21 | | #include <log4cplus/spi/rootlogger.h> |
22 | | #include <log4cplus/helpers/loglog.h> |
23 | | #include <log4cplus/thread/syncprims-pub-impl.h> |
24 | | |
25 | | |
26 | | namespace log4cplus { namespace spi { |
27 | | |
28 | | |
29 | | ////////////////////////////////////////////////////////////////////////////// |
30 | | // RootLogger Constructor |
31 | | ////////////////////////////////////////////////////////////////////////////// |
32 | | |
33 | | RootLogger::RootLogger(Hierarchy& h, LogLevel loglevel) |
34 | 70 | : LoggerImpl(LOG4CPLUS_TEXT("root"), h) |
35 | 70 | { |
36 | 70 | setLogLevel(loglevel); |
37 | 70 | } Unexecuted instantiation: log4cplus::spi::RootLogger::RootLogger(log4cplus::Hierarchy&, int) log4cplus::spi::RootLogger::RootLogger(log4cplus::Hierarchy&, int) Line | Count | Source | 34 | 70 | : LoggerImpl(LOG4CPLUS_TEXT("root"), h) | 35 | 70 | { | 36 | 70 | setLogLevel(loglevel); | 37 | 70 | } |
|
38 | | |
39 | | |
40 | | |
41 | | ////////////////////////////////////////////////////////////////////////////// |
42 | | // Logger Methods |
43 | | ////////////////////////////////////////////////////////////////////////////// |
44 | | |
45 | | LogLevel |
46 | | RootLogger::getChainedLogLevel() const |
47 | 0 | { |
48 | 0 | return ll; |
49 | 0 | } |
50 | | |
51 | | |
52 | | void |
53 | | RootLogger::setLogLevel(LogLevel loglevel) |
54 | 70 | { |
55 | 70 | if(loglevel == NOT_SET_LOG_LEVEL) { |
56 | 0 | helpers::getLogLog().error( |
57 | 0 | LOG4CPLUS_TEXT("You have tried to set NOT_SET_LOG_LEVEL to root.")); |
58 | 0 | } |
59 | 70 | else { |
60 | 70 | LoggerImpl::setLogLevel(loglevel); |
61 | 70 | } |
62 | 70 | } |
63 | | |
64 | | |
65 | | } } // namespace log4cplus { namespace spi { |