/src/logging-log4cxx/src/main/cpp/patternlayout.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/patternlayout.h> |
20 | | #include <log4cxx/pattern/patternparser.h> |
21 | | #include <log4cxx/pattern/loggingeventpatternconverter.h> |
22 | | #include <log4cxx/pattern/formattinginfo.h> |
23 | | #include <log4cxx/helpers/stringhelper.h> |
24 | | #include <log4cxx/helpers/pool.h> |
25 | | #include <log4cxx/helpers/optionconverter.h> |
26 | | |
27 | | #include <log4cxx/pattern/loggerpatternconverter.h> |
28 | | #include <log4cxx/pattern/colorendpatternconverter.h> |
29 | | #include <log4cxx/pattern/colorstartpatternconverter.h> |
30 | | #include <log4cxx/pattern/shortfilelocationpatternconverter.h> |
31 | | #include <log4cxx/pattern/literalpatternconverter.h> |
32 | | #include <log4cxx/helpers/loglog.h> |
33 | | #include <log4cxx/pattern/classnamepatternconverter.h> |
34 | | #include <log4cxx/pattern/datepatternconverter.h> |
35 | | #include <log4cxx/pattern/filedatepatternconverter.h> |
36 | | #include <log4cxx/pattern/filelocationpatternconverter.h> |
37 | | #include <log4cxx/pattern/fulllocationpatternconverter.h> |
38 | | #include <log4cxx/pattern/integerpatternconverter.h> |
39 | | #include <log4cxx/pattern/linelocationpatternconverter.h> |
40 | | #include <log4cxx/pattern/messagepatternconverter.h> |
41 | | #include <log4cxx/pattern/lineseparatorpatternconverter.h> |
42 | | #include <log4cxx/pattern/methodlocationpatternconverter.h> |
43 | | #include <log4cxx/pattern/levelpatternconverter.h> |
44 | | #include <log4cxx/pattern/relativetimepatternconverter.h> |
45 | | #include <log4cxx/pattern/threadpatternconverter.h> |
46 | | #include <log4cxx/pattern/mdcpatternconverter.h> |
47 | | #include <log4cxx/pattern/ndcpatternconverter.h> |
48 | | #include <log4cxx/pattern/propertiespatternconverter.h> |
49 | | #include <log4cxx/pattern/throwableinformationpatternconverter.h> |
50 | | #include <log4cxx/pattern/threadusernamepatternconverter.h> |
51 | | |
52 | | |
53 | | using namespace LOG4CXX_NS; |
54 | | using namespace LOG4CXX_NS::helpers; |
55 | | using namespace LOG4CXX_NS::spi; |
56 | | using namespace LOG4CXX_NS::pattern; |
57 | | |
58 | | struct PatternLayout::PatternLayoutPrivate |
59 | | { |
60 | | PatternLayoutPrivate() |
61 | 2 | : expectedPatternLength(100) |
62 | 2 | {} |
63 | | PatternLayoutPrivate(const LogString& pattern) |
64 | 1.50k | : conversionPattern(pattern) |
65 | 1.50k | , expectedPatternLength(100) |
66 | 1.50k | {} log4cxx::PatternLayout::PatternLayoutPrivate::PatternLayoutPrivate(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 64 | 385 | : conversionPattern(pattern) | 65 | 385 | , expectedPatternLength(100) | 66 | 385 | {} |
log4cxx::PatternLayout::PatternLayoutPrivate::PatternLayoutPrivate(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&) Line | Count | Source | 64 | 1.12k | : conversionPattern(pattern) | 65 | 1.12k | , expectedPatternLength(100) | 66 | 1.12k | {} |
|
67 | | |
68 | | /** |
69 | | * Conversion pattern. |
70 | | */ |
71 | | LogString conversionPattern; |
72 | | |
73 | | /** |
74 | | * Pattern converters. |
75 | | */ |
76 | | LoggingEventPatternConverterList patternConverters; |
77 | | |
78 | | /** |
79 | | * Field widths and alignment corresponding to pattern converters. |
80 | | */ |
81 | | FormattingInfoList patternFields; |
82 | | |
83 | | LogString m_fatalColor = LOG4CXX_STR("\\x1B[35m"); //magenta |
84 | | LogString m_errorColor = LOG4CXX_STR("\\x1B[31m"); //red |
85 | | LogString m_warnColor = LOG4CXX_STR("\\x1B[33m"); //yellow |
86 | | LogString m_infoColor = LOG4CXX_STR("\\x1B[32m"); //green |
87 | | LogString m_debugColor = LOG4CXX_STR("\\x1B[36m"); //cyan; |
88 | | LogString m_traceColor = LOG4CXX_STR("\\x1B[34m"); //blue; |
89 | | |
90 | | // Expected length of a formatted event excluding the message text |
91 | | size_t expectedPatternLength; |
92 | | }; |
93 | | |
94 | | IMPLEMENT_LOG4CXX_OBJECT(PatternLayout) |
95 | | |
96 | | |
97 | | PatternLayout::PatternLayout() : |
98 | 2 | m_priv(std::make_unique<PatternLayoutPrivate>()) |
99 | 2 | { |
100 | 2 | } Unexecuted instantiation: log4cxx::PatternLayout::PatternLayout() log4cxx::PatternLayout::PatternLayout() Line | Count | Source | 98 | 2 | m_priv(std::make_unique<PatternLayoutPrivate>()) | 99 | 2 | { | 100 | 2 | } |
|
101 | | |
102 | | /** |
103 | | Constructs a PatternLayout using the supplied conversion pattern. |
104 | | */ |
105 | | PatternLayout::PatternLayout(const LogString& pattern) : |
106 | 1.50k | m_priv(std::make_unique<PatternLayoutPrivate>(pattern)) |
107 | 1.50k | { |
108 | 1.50k | Pool pool; |
109 | 1.50k | activateOptions(pool); |
110 | 1.50k | } Unexecuted instantiation: log4cxx::PatternLayout::PatternLayout(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) log4cxx::PatternLayout::PatternLayout(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 106 | 385 | m_priv(std::make_unique<PatternLayoutPrivate>(pattern)) | 107 | 385 | { | 108 | 385 | Pool pool; | 109 | 385 | activateOptions(pool); | 110 | 385 | } |
Unexecuted instantiation: log4cxx::PatternLayout::PatternLayout(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&) log4cxx::PatternLayout::PatternLayout(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&) Line | Count | Source | 106 | 1.12k | m_priv(std::make_unique<PatternLayoutPrivate>(pattern)) | 107 | 1.12k | { | 108 | 1.12k | Pool pool; | 109 | 1.12k | activateOptions(pool); | 110 | 1.12k | } |
|
111 | | |
112 | 1.50k | PatternLayout::~PatternLayout() {} |
113 | | |
114 | | void PatternLayout::setConversionPattern(const LogString& pattern) |
115 | 0 | { |
116 | 0 | m_priv->conversionPattern = pattern; |
117 | 0 | Pool pool; |
118 | 0 | activateOptions(pool); |
119 | 0 | } Unexecuted instantiation: log4cxx::PatternLayout::setConversionPattern(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: log4cxx::PatternLayout::setConversionPattern(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&) |
120 | | |
121 | | void PatternLayout::format(LogString& output, |
122 | | const spi::LoggingEventPtr& event, |
123 | | Pool& pool) const |
124 | 212k | { |
125 | 212k | auto& lsMsg = event->getRenderedMessage(); |
126 | 212k | output.reserve(m_priv->expectedPatternLength + lsMsg.size()); |
127 | 212k | std::vector<FormattingInfoPtr>::const_iterator formatterIter = |
128 | 212k | m_priv->patternFields.begin(); |
129 | | |
130 | 212k | for (std::vector<LoggingEventPatternConverterPtr>::const_iterator |
131 | 212k | converterIter = m_priv->patternConverters.begin(); |
132 | 2.23M | converterIter != m_priv->patternConverters.end(); |
133 | 2.02M | converterIter++, formatterIter++) |
134 | 2.02M | { |
135 | 2.02M | int startField = (int)output.length(); |
136 | 2.02M | (*converterIter)->format(event, output, pool); |
137 | 2.02M | (*formatterIter)->format(startField, output); |
138 | 2.02M | } |
139 | | |
140 | 212k | } log4cxx::PatternLayout::format(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::shared_ptr<log4cxx::spi::LoggingEvent> const&, log4cxx::helpers::Pool&) const Line | Count | Source | 124 | 44.5k | { | 125 | 44.5k | auto& lsMsg = event->getRenderedMessage(); | 126 | 44.5k | output.reserve(m_priv->expectedPatternLength + lsMsg.size()); | 127 | 44.5k | std::vector<FormattingInfoPtr>::const_iterator formatterIter = | 128 | 44.5k | m_priv->patternFields.begin(); | 129 | | | 130 | 44.5k | for (std::vector<LoggingEventPatternConverterPtr>::const_iterator | 131 | 44.5k | converterIter = m_priv->patternConverters.begin(); | 132 | 464k | converterIter != m_priv->patternConverters.end(); | 133 | 419k | converterIter++, formatterIter++) | 134 | 419k | { | 135 | 419k | int startField = (int)output.length(); | 136 | 419k | (*converterIter)->format(event, output, pool); | 137 | 419k | (*formatterIter)->format(startField, output); | 138 | 419k | } | 139 | | | 140 | 44.5k | } |
log4cxx::PatternLayout::format(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >&, std::__1::shared_ptr<log4cxx::spi::LoggingEvent> const&, log4cxx::helpers::Pool&) const Line | Count | Source | 124 | 168k | { | 125 | 168k | auto& lsMsg = event->getRenderedMessage(); | 126 | 168k | output.reserve(m_priv->expectedPatternLength + lsMsg.size()); | 127 | 168k | std::vector<FormattingInfoPtr>::const_iterator formatterIter = | 128 | 168k | m_priv->patternFields.begin(); | 129 | | | 130 | 168k | for (std::vector<LoggingEventPatternConverterPtr>::const_iterator | 131 | 168k | converterIter = m_priv->patternConverters.begin(); | 132 | 1.77M | converterIter != m_priv->patternConverters.end(); | 133 | 1.60M | converterIter++, formatterIter++) | 134 | 1.60M | { | 135 | 1.60M | int startField = (int)output.length(); | 136 | 1.60M | (*converterIter)->format(event, output, pool); | 137 | 1.60M | (*formatterIter)->format(startField, output); | 138 | 1.60M | } | 139 | | | 140 | 168k | } |
|
141 | | |
142 | | void PatternLayout::setOption(const LogString& option, const LogString& value) |
143 | 2 | { |
144 | 2 | if (StringHelper::equalsIgnoreCase(option, |
145 | 2 | LOG4CXX_STR("CONVERSIONPATTERN"), |
146 | 2 | LOG4CXX_STR("conversionpattern"))) |
147 | 2 | { |
148 | 2 | m_priv->conversionPattern = OptionConverter::convertSpecialChars(value); |
149 | 2 | }else if(StringHelper::equalsIgnoreCase(option, |
150 | 0 | LOG4CXX_STR("ERRORCOLOR"), |
151 | 0 | LOG4CXX_STR("errorcolor"))){ |
152 | 0 | m_priv->m_errorColor = value; |
153 | 0 | if (LogLog::isDebugEnabled()) |
154 | 0 | { |
155 | 0 | LogString msg(LOG4CXX_STR("Setting error color to ")); |
156 | 0 | msg += value; |
157 | 0 | LogLog::debug(msg); |
158 | 0 | } |
159 | 0 | }else if(StringHelper::equalsIgnoreCase(option, |
160 | 0 | LOG4CXX_STR("FATALCOLOR"), |
161 | 0 | LOG4CXX_STR("fatalcolor"))){ |
162 | 0 | m_priv->m_fatalColor = value; |
163 | 0 | }else if(StringHelper::equalsIgnoreCase(option, |
164 | 0 | LOG4CXX_STR("WARNCOLOR"), |
165 | 0 | LOG4CXX_STR("warncolor"))){ |
166 | 0 | m_priv->m_warnColor = value; |
167 | 0 | }else if(StringHelper::equalsIgnoreCase(option, |
168 | 0 | LOG4CXX_STR("INFOCOLOR"), |
169 | 0 | LOG4CXX_STR("infocolor"))){ |
170 | 0 | m_priv->m_infoColor = value; |
171 | 0 | }else if(StringHelper::equalsIgnoreCase(option, |
172 | 0 | LOG4CXX_STR("DEBUGCOLOR"), |
173 | 0 | LOG4CXX_STR("debugcolor"))){ |
174 | 0 | m_priv->m_debugColor = value; |
175 | 0 | }else if(StringHelper::equalsIgnoreCase(option, |
176 | 0 | LOG4CXX_STR("TRACECOLOR"), |
177 | 0 | LOG4CXX_STR("tracecolor"))){ |
178 | 0 | m_priv->m_traceColor = value; |
179 | 0 | } |
180 | 2 | } log4cxx::PatternLayout::setOption(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 143 | 1 | { | 144 | 1 | if (StringHelper::equalsIgnoreCase(option, | 145 | 1 | LOG4CXX_STR("CONVERSIONPATTERN"), | 146 | 1 | LOG4CXX_STR("conversionpattern"))) | 147 | 1 | { | 148 | 1 | m_priv->conversionPattern = OptionConverter::convertSpecialChars(value); | 149 | 1 | }else if(StringHelper::equalsIgnoreCase(option, | 150 | 0 | LOG4CXX_STR("ERRORCOLOR"), | 151 | 0 | LOG4CXX_STR("errorcolor"))){ | 152 | 0 | m_priv->m_errorColor = value; | 153 | 0 | if (LogLog::isDebugEnabled()) | 154 | 0 | { | 155 | 0 | LogString msg(LOG4CXX_STR("Setting error color to ")); | 156 | 0 | msg += value; | 157 | 0 | LogLog::debug(msg); | 158 | 0 | } | 159 | 0 | }else if(StringHelper::equalsIgnoreCase(option, | 160 | 0 | LOG4CXX_STR("FATALCOLOR"), | 161 | 0 | LOG4CXX_STR("fatalcolor"))){ | 162 | 0 | m_priv->m_fatalColor = value; | 163 | 0 | }else if(StringHelper::equalsIgnoreCase(option, | 164 | 0 | LOG4CXX_STR("WARNCOLOR"), | 165 | 0 | LOG4CXX_STR("warncolor"))){ | 166 | 0 | m_priv->m_warnColor = value; | 167 | 0 | }else if(StringHelper::equalsIgnoreCase(option, | 168 | 0 | LOG4CXX_STR("INFOCOLOR"), | 169 | 0 | LOG4CXX_STR("infocolor"))){ | 170 | 0 | m_priv->m_infoColor = value; | 171 | 0 | }else if(StringHelper::equalsIgnoreCase(option, | 172 | 0 | LOG4CXX_STR("DEBUGCOLOR"), | 173 | 0 | LOG4CXX_STR("debugcolor"))){ | 174 | 0 | m_priv->m_debugColor = value; | 175 | 0 | }else if(StringHelper::equalsIgnoreCase(option, | 176 | 0 | LOG4CXX_STR("TRACECOLOR"), | 177 | 0 | LOG4CXX_STR("tracecolor"))){ | 178 | 0 | m_priv->m_traceColor = value; | 179 | 0 | } | 180 | 1 | } |
log4cxx::PatternLayout::setOption(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&) Line | Count | Source | 143 | 1 | { | 144 | 1 | if (StringHelper::equalsIgnoreCase(option, | 145 | 1 | LOG4CXX_STR("CONVERSIONPATTERN"), | 146 | 1 | LOG4CXX_STR("conversionpattern"))) | 147 | 1 | { | 148 | 1 | m_priv->conversionPattern = OptionConverter::convertSpecialChars(value); | 149 | 1 | }else if(StringHelper::equalsIgnoreCase(option, | 150 | 0 | LOG4CXX_STR("ERRORCOLOR"), | 151 | 0 | LOG4CXX_STR("errorcolor"))){ | 152 | 0 | m_priv->m_errorColor = value; | 153 | 0 | if (LogLog::isDebugEnabled()) | 154 | 0 | { | 155 | 0 | LogString msg(LOG4CXX_STR("Setting error color to ")); | 156 | 0 | msg += value; | 157 | 0 | LogLog::debug(msg); | 158 | 0 | } | 159 | 0 | }else if(StringHelper::equalsIgnoreCase(option, | 160 | 0 | LOG4CXX_STR("FATALCOLOR"), | 161 | 0 | LOG4CXX_STR("fatalcolor"))){ | 162 | 0 | m_priv->m_fatalColor = value; | 163 | 0 | }else if(StringHelper::equalsIgnoreCase(option, | 164 | 0 | LOG4CXX_STR("WARNCOLOR"), | 165 | 0 | LOG4CXX_STR("warncolor"))){ | 166 | 0 | m_priv->m_warnColor = value; | 167 | 0 | }else if(StringHelper::equalsIgnoreCase(option, | 168 | 0 | LOG4CXX_STR("INFOCOLOR"), | 169 | 0 | LOG4CXX_STR("infocolor"))){ | 170 | 0 | m_priv->m_infoColor = value; | 171 | 0 | }else if(StringHelper::equalsIgnoreCase(option, | 172 | 0 | LOG4CXX_STR("DEBUGCOLOR"), | 173 | 0 | LOG4CXX_STR("debugcolor"))){ | 174 | 0 | m_priv->m_debugColor = value; | 175 | 0 | }else if(StringHelper::equalsIgnoreCase(option, | 176 | 0 | LOG4CXX_STR("TRACECOLOR"), | 177 | 0 | LOG4CXX_STR("tracecolor"))){ | 178 | 0 | m_priv->m_traceColor = value; | 179 | 0 | } | 180 | 1 | } |
|
181 | | |
182 | | void PatternLayout::activateOptions(Pool&) |
183 | 1.50k | { |
184 | 1.50k | LogString pat(m_priv->conversionPattern); |
185 | | |
186 | 1.50k | if (pat.empty()) |
187 | 0 | { |
188 | 0 | pat = LOG4CXX_STR("%m%n"); |
189 | 0 | } |
190 | | |
191 | 1.50k | m_priv->patternConverters.erase(m_priv->patternConverters.begin(), m_priv->patternConverters.end()); |
192 | 1.50k | m_priv->patternFields.erase(m_priv->patternFields.begin(), m_priv->patternFields.end()); |
193 | 1.50k | std::vector<PatternConverterPtr> converters; |
194 | 1.50k | PatternParser::parse(pat, |
195 | 1.50k | converters, |
196 | 1.50k | m_priv->patternFields, |
197 | 1.50k | getFormatSpecifiers()); |
198 | | |
199 | | // |
200 | | // strip out any pattern converters that don't handle LoggingEvents |
201 | | // |
202 | | // |
203 | 1.50k | for (auto const& converterItem : converters) |
204 | 6.04k | { |
205 | 6.04k | if (auto eventConverter = LOG4CXX_NS::cast<LoggingEventPatternConverter>(converterItem)) |
206 | 6.04k | { |
207 | 6.04k | m_priv->patternConverters.push_back(eventConverter); |
208 | 6.04k | } |
209 | 6.04k | } |
210 | 1.50k | m_priv->expectedPatternLength = getFormattedEventCharacterCount() * 2; |
211 | 1.50k | } |
212 | | |
213 | | #define RULES_PUT(spec, cls) \ |
214 | 48.2k | specs.insert(PatternMap::value_type(LogString(LOG4CXX_STR(spec)), cls ::newInstance)) |
215 | | |
216 | | |
217 | | LOG4CXX_NS::pattern::PatternMap PatternLayout::getFormatSpecifiers() |
218 | 1.50k | { |
219 | 1.50k | PatternMap specs; |
220 | 1.50k | RULES_PUT("c", LoggerPatternConverter); |
221 | 1.50k | RULES_PUT("logger", LoggerPatternConverter); |
222 | | |
223 | 1.50k | RULES_PUT("C", ClassNamePatternConverter); |
224 | 1.50k | RULES_PUT("class", ClassNamePatternConverter); |
225 | | |
226 | 1.50k | specs.insert(PatternMap::value_type(LogString(LOG4CXX_STR("Y")), std::bind(&PatternLayout::createColorStartPatternConverter, this, std::placeholders::_1))); |
227 | 1.50k | RULES_PUT("y", ColorEndPatternConverter); |
228 | | |
229 | 1.50k | RULES_PUT("d", DatePatternConverter); |
230 | 1.50k | RULES_PUT("date", DatePatternConverter); |
231 | | |
232 | 1.50k | RULES_PUT("f", ShortFileLocationPatternConverter); |
233 | | |
234 | 1.50k | RULES_PUT("F", FileLocationPatternConverter); |
235 | 1.50k | RULES_PUT("file", FileLocationPatternConverter); |
236 | | |
237 | 1.50k | RULES_PUT("l", FullLocationPatternConverter); |
238 | | |
239 | 1.50k | RULES_PUT("L", LineLocationPatternConverter); |
240 | 1.50k | RULES_PUT("line", LineLocationPatternConverter); |
241 | | |
242 | 1.50k | RULES_PUT("m", MessagePatternConverter); |
243 | 1.50k | RULES_PUT("message", MessagePatternConverter); |
244 | | |
245 | 1.50k | RULES_PUT("n", LineSeparatorPatternConverter); |
246 | | |
247 | 1.50k | RULES_PUT("M", MethodLocationPatternConverter); |
248 | 1.50k | RULES_PUT("method", MethodLocationPatternConverter); |
249 | | |
250 | 1.50k | RULES_PUT("p", LevelPatternConverter); |
251 | 1.50k | RULES_PUT("level", LevelPatternConverter); |
252 | | |
253 | 1.50k | RULES_PUT("r", RelativeTimePatternConverter); |
254 | 1.50k | RULES_PUT("relative", RelativeTimePatternConverter); |
255 | | |
256 | 1.50k | RULES_PUT("t", ThreadPatternConverter); |
257 | 1.50k | RULES_PUT("thread", ThreadPatternConverter); |
258 | | |
259 | 1.50k | RULES_PUT("T", ThreadUsernamePatternConverter); |
260 | 1.50k | RULES_PUT("threadname", ThreadUsernamePatternConverter); |
261 | | |
262 | 1.50k | RULES_PUT("x", NDCPatternConverter); |
263 | 1.50k | RULES_PUT("ndc", NDCPatternConverter); |
264 | | |
265 | 1.50k | RULES_PUT("X", PropertiesPatternConverter); |
266 | 1.50k | RULES_PUT("J", MDCPatternConverter); |
267 | 1.50k | RULES_PUT("properties", PropertiesPatternConverter); |
268 | | |
269 | 1.50k | RULES_PUT("throwable", ThrowableInformationPatternConverter); |
270 | 1.50k | return specs; |
271 | 1.50k | } |
272 | | |
273 | | LogString PatternLayout::getConversionPattern() const |
274 | 0 | { |
275 | 0 | return m_priv->conversionPattern; |
276 | 0 | } |
277 | | |
278 | 0 | pattern::PatternConverterPtr PatternLayout::createColorStartPatternConverter(const std::vector<LogString>& options){ |
279 | 0 | std::shared_ptr<ColorStartPatternConverter> colorPatternConverter = std::make_shared<ColorStartPatternConverter>(); |
280 | |
|
281 | 0 | colorPatternConverter->setErrorColor(m_priv->m_errorColor); |
282 | 0 | colorPatternConverter->setFatalColor(m_priv->m_fatalColor); |
283 | 0 | colorPatternConverter->setWarnColor(m_priv->m_warnColor); |
284 | 0 | colorPatternConverter->setInfoColor(m_priv->m_infoColor); |
285 | 0 | colorPatternConverter->setDebugColor(m_priv->m_debugColor); |
286 | 0 | colorPatternConverter->setTraceColor(m_priv->m_traceColor); |
287 | |
|
288 | 0 | return colorPatternConverter; |
289 | 0 | } Unexecuted instantiation: log4cxx::PatternLayout::createColorStartPatternConverter(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&) Unexecuted instantiation: log4cxx::PatternLayout::createColorStartPatternConverter(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&) |
290 | | |
291 | | |
292 | | |