/src/logging-log4cxx/src/main/cpp/loggerpatternconverter.cpp
Line | Count | Source |
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 | | #include <log4cxx/logstring.h> |
19 | | #include <log4cxx/pattern/loggerpatternconverter.h> |
20 | | #include <log4cxx/spi/loggingevent.h> |
21 | | #include <log4cxx/spi/location/locationinfo.h> |
22 | | |
23 | | using namespace LOG4CXX_NS; |
24 | | using namespace LOG4CXX_NS::pattern; |
25 | | using namespace LOG4CXX_NS::spi; |
26 | | using namespace LOG4CXX_NS::helpers; |
27 | | |
28 | | IMPLEMENT_LOG4CXX_OBJECT(LoggerPatternConverter) |
29 | | |
30 | | LoggerPatternConverter::LoggerPatternConverter( |
31 | | const std::vector<LogString>& options) : |
32 | 8.84k | NamePatternConverter(LOG4CXX_STR("Logger"), |
33 | 8.84k | LOG4CXX_STR("logger"), options) |
34 | 8.84k | { |
35 | 8.84k | } Unexecuted instantiation: log4cxx::pattern::LoggerPatternConverter::LoggerPatternConverter(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) log4cxx::pattern::LoggerPatternConverter::LoggerPatternConverter(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) Line | Count | Source | 32 | 5.69k | NamePatternConverter(LOG4CXX_STR("Logger"), | 33 | 5.69k | LOG4CXX_STR("logger"), options) | 34 | 5.69k | { | 35 | 5.69k | } |
Unexecuted instantiation: log4cxx::pattern::LoggerPatternConverter::LoggerPatternConverter(std::__1::vector<std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >, std::__1::allocator<std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > > > const&) log4cxx::pattern::LoggerPatternConverter::LoggerPatternConverter(std::__1::vector<std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >, std::__1::allocator<std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > > > const&) Line | Count | Source | 32 | 3.14k | NamePatternConverter(LOG4CXX_STR("Logger"), | 33 | 3.14k | LOG4CXX_STR("logger"), options) | 34 | 3.14k | { | 35 | 3.14k | } |
|
36 | | |
37 | | PatternConverterPtr LoggerPatternConverter::newInstance( |
38 | | const std::vector<LogString>& options) |
39 | 9.41k | { |
40 | 9.41k | if (options.size() == 0) |
41 | 1.57k | { |
42 | 1.57k | static WideLife<PatternConverterPtr> def = std::make_shared<LoggerPatternConverter>(options); |
43 | 1.57k | return def; |
44 | 1.57k | } |
45 | | |
46 | 7.84k | return std::make_shared<LoggerPatternConverter>(options); |
47 | 9.41k | } log4cxx::pattern::LoggerPatternConverter::newInstance(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) Line | Count | Source | 39 | 6.29k | { | 40 | 6.29k | if (options.size() == 0) | 41 | 1.10k | { | 42 | 1.10k | static WideLife<PatternConverterPtr> def = std::make_shared<LoggerPatternConverter>(options); | 43 | 1.10k | return def; | 44 | 1.10k | } | 45 | | | 46 | 5.19k | return std::make_shared<LoggerPatternConverter>(options); | 47 | 6.29k | } |
log4cxx::pattern::LoggerPatternConverter::newInstance(std::__1::vector<std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >, std::__1::allocator<std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > > > const&) Line | Count | Source | 39 | 3.12k | { | 40 | 3.12k | if (options.size() == 0) | 41 | 471 | { | 42 | 471 | static WideLife<PatternConverterPtr> def = std::make_shared<LoggerPatternConverter>(options); | 43 | 471 | return def; | 44 | 471 | } | 45 | | | 46 | 2.65k | return std::make_shared<LoggerPatternConverter>(options); | 47 | 3.12k | } |
|
48 | | |
49 | | void LoggerPatternConverter::format( |
50 | | const LoggingEventPtr& event, |
51 | | LogString& toAppendTo, |
52 | | Pool& /* p */ ) const |
53 | 5.24k | { |
54 | 5.24k | int initialLength = (int)toAppendTo.length(); |
55 | 5.24k | toAppendTo.append(event->getLoggerName()); |
56 | 5.24k | abbreviate(initialLength, toAppendTo); |
57 | 5.24k | } log4cxx::pattern::LoggerPatternConverter::format(std::__1::shared_ptr<log4cxx::spi::LoggingEvent> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, log4cxx::helpers::Pool&) const Line | Count | Source | 53 | 4.75k | { | 54 | 4.75k | int initialLength = (int)toAppendTo.length(); | 55 | 4.75k | toAppendTo.append(event->getLoggerName()); | 56 | 4.75k | abbreviate(initialLength, toAppendTo); | 57 | 4.75k | } |
log4cxx::pattern::LoggerPatternConverter::format(std::__1::shared_ptr<log4cxx::spi::LoggingEvent> const&, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >&, log4cxx::helpers::Pool&) const Line | Count | Source | 53 | 490 | { | 54 | 490 | int initialLength = (int)toAppendTo.length(); | 55 | 490 | toAppendTo.append(event->getLoggerName()); | 56 | 490 | abbreviate(initialLength, toAppendTo); | 57 | 490 | } |
|