log4r 1.1.6 → 1.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README +3 -3
- data/Rakefile +2 -2
- data/doc/rdoc/Log4r.html +519 -0
- data/doc/rdoc/Log4r/BasicFormatter.html +388 -0
- data/doc/rdoc/Log4r/ConfigError.html +225 -0
- data/doc/rdoc/Log4r/Configurator.html +1068 -0
- data/doc/rdoc/Log4r/DateFileOutputter.html +479 -0
- data/doc/rdoc/Log4r/DefaultFormatter.html +223 -0
- data/doc/rdoc/Log4r/EmailOutputter.html +654 -0
- data/doc/rdoc/Log4r/FileOutputter.html +346 -0
- data/doc/rdoc/Log4r/Formatter.html +309 -0
- data/doc/rdoc/Log4r/GDC.html +346 -0
- data/doc/rdoc/Log4r/GDC_rb.html +80 -0
- data/doc/rdoc/Log4r/IOOutputter.html +410 -0
- data/doc/rdoc/Log4r/Log4jXmlFormatter.html +337 -0
- data/doc/rdoc/Log4r/Log4rConfig.html +211 -0
- data/doc/rdoc/Log4r/Log4rTools.html +388 -0
- data/doc/rdoc/Log4r/LogEvent.html +378 -0
- data/doc/rdoc/Log4r/LogServer.html +340 -0
- data/doc/rdoc/Log4r/Logger.html +1150 -0
- data/doc/rdoc/Log4r/Logger/LoggerFactory.html +218 -0
- data/doc/rdoc/Log4r/Logger/Repository.html +225 -0
- data/doc/rdoc/Log4r/MDC.html +424 -0
- data/doc/rdoc/Log4r/MDC_rb.html +83 -0
- data/doc/rdoc/Log4r/NDC.html +632 -0
- data/doc/rdoc/Log4r/NDC_rb.html +110 -0
- data/doc/rdoc/Log4r/ObjectFormatter.html +280 -0
- data/doc/rdoc/Log4r/Outputter.html +934 -0
- data/doc/rdoc/Log4r/Outputter/OutputterFactory.html +218 -0
- data/doc/rdoc/Log4r/Outputter/consoleoutputters_rb.html +57 -0
- data/doc/rdoc/Log4r/Outputter/datefileoutputter_rb.html +93 -0
- data/doc/rdoc/Log4r/Outputter/emailoutputter_rb.html +179 -0
- data/doc/rdoc/Log4r/Outputter/fileoutputter_rb.html +64 -0
- data/doc/rdoc/Log4r/Outputter/iooutputter_rb.html +59 -0
- data/doc/rdoc/Log4r/Outputter/outputter_rb.html +222 -0
- data/doc/rdoc/Log4r/Outputter/outputterfactory_rb.html +62 -0
- data/doc/rdoc/Log4r/Outputter/remoteoutputter_rb.html +59 -0
- data/doc/rdoc/Log4r/Outputter/rollingfileoutputter_rb.html +66 -0
- data/doc/rdoc/Log4r/Outputter/staticoutputter_rb.html +55 -0
- data/doc/rdoc/Log4r/Outputter/syslogoutputter_rb.html +110 -0
- data/doc/rdoc/Log4r/Outputter/udpoutputter_rb.html +220 -0
- data/doc/rdoc/Log4r/PatternFormatter.html +404 -0
- data/doc/rdoc/Log4r/ROMPClient.html +211 -0
- data/doc/rdoc/Log4r/ROMPServer.html +211 -0
- data/doc/rdoc/Log4r/RemoteOutputter.html +402 -0
- data/doc/rdoc/Log4r/RollingFileOutputter.html +551 -0
- data/doc/rdoc/Log4r/RootLogger.html +530 -0
- data/doc/rdoc/Log4r/SimpleFormatter.html +276 -0
- data/doc/rdoc/Log4r/StderrOutputter.html +268 -0
- data/doc/rdoc/Log4r/StdoutOutputter.html +268 -0
- data/doc/rdoc/Log4r/SyslogOutputter.html +551 -0
- data/doc/rdoc/Log4r/UDPOutputter.html +379 -0
- data/doc/rdoc/Log4r/YamlConfigurator.html +966 -0
- data/doc/rdoc/Log4r/base_rb.html +57 -0
- data/doc/rdoc/Log4r/config_rb.html +122 -0
- data/doc/rdoc/Log4r/configurator_rb.html +370 -0
- data/doc/rdoc/Log4r/formatter/formatter_rb.html +121 -0
- data/doc/rdoc/Log4r/formatter/log4jxmlformatter_rb.html +64 -0
- data/doc/rdoc/Log4r/formatter/patternformatter_rb.html +239 -0
- data/doc/rdoc/Log4r/lib/drbloader_rb.html +57 -0
- data/doc/rdoc/Log4r/lib/xmlloader_rb.html +57 -0
- data/doc/rdoc/Log4r/logevent_rb.html +55 -0
- data/doc/rdoc/Log4r/logger_rb.html +293 -0
- data/doc/rdoc/Log4r/loggerfactory_rb.html +66 -0
- data/doc/rdoc/Log4r/logserver_rb.html +161 -0
- data/doc/rdoc/Log4r/rdoc/GDC.html +175 -0
- data/doc/rdoc/Log4r/rdoc/MDC.html +178 -0
- data/doc/rdoc/Log4r/rdoc/NDC.html +207 -0
- data/doc/rdoc/Log4r/rdoc/configurator.html +462 -0
- data/doc/rdoc/Log4r/rdoc/emailoutputter.html +279 -0
- data/doc/rdoc/Log4r/rdoc/formatter.html +218 -0
- data/doc/rdoc/Log4r/rdoc/log4r.html +286 -0
- data/doc/rdoc/Log4r/rdoc/logger.html +382 -0
- data/doc/rdoc/Log4r/rdoc/logserver.html +265 -0
- data/doc/rdoc/Log4r/rdoc/outputter.html +313 -0
- data/doc/rdoc/Log4r/rdoc/patternformatter.html +331 -0
- data/doc/rdoc/Log4r/rdoc/syslogoutputter.html +197 -0
- data/doc/rdoc/Log4r/rdoc/win32eventoutputter.html +165 -0
- data/doc/rdoc/Log4r/rdoc/yamlconfigurator.html +187 -0
- data/doc/rdoc/Log4r/repository_rb.html +74 -0
- data/doc/rdoc/Log4r/staticlogger_rb.html +55 -0
- data/doc/rdoc/Log4r/yamlconfigurator_rb.html +95 -0
- data/doc/rdoc/REXML.html +211 -0
- data/doc/rdoc/created.rid +1 -0
- data/doc/rdoc/images/brick.png +0 -0
- data/doc/rdoc/images/brick_link.png +0 -0
- data/doc/rdoc/images/bug.png +0 -0
- data/doc/rdoc/images/bullet_black.png +0 -0
- data/doc/rdoc/images/bullet_toggle_minus.png +0 -0
- data/doc/rdoc/images/bullet_toggle_plus.png +0 -0
- data/doc/rdoc/images/date.png +0 -0
- data/doc/rdoc/images/find.png +0 -0
- data/doc/rdoc/images/loadingAnimation.gif +0 -0
- data/doc/rdoc/images/macFFBgHack.png +0 -0
- data/doc/rdoc/images/package.png +0 -0
- data/doc/rdoc/images/page_green.png +0 -0
- data/doc/rdoc/images/page_white_text.png +0 -0
- data/doc/rdoc/images/page_white_width.png +0 -0
- data/doc/rdoc/images/plugin.png +0 -0
- data/doc/rdoc/images/ruby.png +0 -0
- data/doc/rdoc/images/tag_green.png +0 -0
- data/doc/rdoc/images/wrench.png +0 -0
- data/doc/rdoc/images/wrench_orange.png +0 -0
- data/doc/rdoc/images/zoom.png +0 -0
- data/doc/rdoc/index.html +585 -0
- data/doc/rdoc/js/darkfish.js +116 -0
- data/doc/rdoc/js/jquery.js +32 -0
- data/doc/rdoc/js/quicksearch.js +114 -0
- data/doc/rdoc/js/thickbox-compressed.js +10 -0
- data/doc/rdoc/log4r-rdoc.css +696 -0
- data/doc/rdoc/log4r_rb.html +207 -0
- data/doc/rdoc/rdoc.css +696 -0
- data/examples/rdoc-gen +2 -0
- data/src/log4r.rb +2 -2
- data/src/log4r/formatter/patternformatter.rb +15 -15
- data/src/log4r/outputter/udpoutputter.rb +4 -4
- data/tests/testchainsaw.rb +1 -1
- metadata +123 -8
- data/src/log4r/outputter/datefileoutputter.patch +0 -24
- data/src/log4r/outputter/diff +0 -14
- data/src/log4r/outputter/new-datefileoutputter.rb +0 -117
@@ -0,0 +1,1068 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Class: Log4r::Configurator</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="../js/jquery.js" type="text/javascript"
|
13
|
+
charset="utf-8"></script>
|
14
|
+
<script src="../js/thickbox-compressed.js" type="text/javascript"
|
15
|
+
charset="utf-8"></script>
|
16
|
+
<script src="../js/quicksearch.js" type="text/javascript"
|
17
|
+
charset="utf-8"></script>
|
18
|
+
<script src="../js/darkfish.js" type="text/javascript"
|
19
|
+
charset="utf-8"></script>
|
20
|
+
|
21
|
+
</head>
|
22
|
+
<body class="class">
|
23
|
+
|
24
|
+
<div id="metadata">
|
25
|
+
<div id="file-metadata">
|
26
|
+
<div id="file-list-section" class="section">
|
27
|
+
<h3 class="section-header">In Files</h3>
|
28
|
+
<div class="section-body">
|
29
|
+
<ul>
|
30
|
+
|
31
|
+
<li><a href="../log4r/configurator_rb.html?TB_iframe=true&height=550&width=785"
|
32
|
+
class="thickbox" title="log4r/configurator.rb">log4r/configurator.rb</a></li>
|
33
|
+
|
34
|
+
</ul>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div id="class-metadata">
|
42
|
+
|
43
|
+
<!-- Parent Class -->
|
44
|
+
|
45
|
+
<div id="parent-class-section" class="section">
|
46
|
+
<h3 class="section-header">Parent</h3>
|
47
|
+
|
48
|
+
<p class="link">Object</p>
|
49
|
+
|
50
|
+
</div>
|
51
|
+
|
52
|
+
|
53
|
+
<!-- Namespace Contents -->
|
54
|
+
|
55
|
+
|
56
|
+
<!-- Method Quickref -->
|
57
|
+
|
58
|
+
<div id="method-list-section" class="section">
|
59
|
+
<h3 class="section-header">Methods</h3>
|
60
|
+
<ul class="link-list">
|
61
|
+
|
62
|
+
<li><a href="#M000009">::[]</a></li>
|
63
|
+
|
64
|
+
<li><a href="#M000010">::[]=</a></li>
|
65
|
+
|
66
|
+
<li><a href="#M000018">::actual_load</a></li>
|
67
|
+
|
68
|
+
<li><a href="#M000014">::custom_levels</a></li>
|
69
|
+
|
70
|
+
<li><a href="#M000022">::decode_custom_levels</a></li>
|
71
|
+
|
72
|
+
<li><a href="#M000027">::decode_formatter</a></li>
|
73
|
+
|
74
|
+
<li><a href="#M000029">::decode_hash_params</a></li>
|
75
|
+
|
76
|
+
<li><a href="#M000031">::decode_logger</a></li>
|
77
|
+
|
78
|
+
<li><a href="#M000034">::decode_logger_common</a></li>
|
79
|
+
|
80
|
+
<li><a href="#M000033">::decode_logserver</a></li>
|
81
|
+
|
82
|
+
<li><a href="#M000026">::decode_outputter</a></li>
|
83
|
+
|
84
|
+
<li><a href="#M000025">::decode_parameter</a></li>
|
85
|
+
|
86
|
+
<li><a href="#M000024">::decode_parameters</a></li>
|
87
|
+
|
88
|
+
<li><a href="#M000021">::decode_pre_config</a></li>
|
89
|
+
|
90
|
+
<li><a href="#M000020">::decode_xml</a></li>
|
91
|
+
|
92
|
+
<li><a href="#M000017">::detect_rexml</a></li>
|
93
|
+
|
94
|
+
<li><a href="#M000023">::global_config</a></li>
|
95
|
+
|
96
|
+
<li><a href="#M000015">::load_xml_file</a></li>
|
97
|
+
|
98
|
+
<li><a href="#M000016">::load_xml_string</a></li>
|
99
|
+
|
100
|
+
<li><a href="#M000030">::paramsub</a></li>
|
101
|
+
|
102
|
+
</ul>
|
103
|
+
</div>
|
104
|
+
|
105
|
+
|
106
|
+
<!-- Included Modules -->
|
107
|
+
|
108
|
+
<div id="includes-section" class="section">
|
109
|
+
<h3 class="section-header">Included Modules</h3>
|
110
|
+
<ul class="link-list">
|
111
|
+
|
112
|
+
|
113
|
+
<li><a class="include" href="../REXML.html">REXML</a></li>
|
114
|
+
|
115
|
+
|
116
|
+
</ul>
|
117
|
+
</div>
|
118
|
+
|
119
|
+
</div>
|
120
|
+
|
121
|
+
<div id="project-metadata">
|
122
|
+
|
123
|
+
|
124
|
+
<div id="fileindex-section" class="section project-section">
|
125
|
+
<h3 class="section-header">Files</h3>
|
126
|
+
<ul>
|
127
|
+
|
128
|
+
<li class="file"><a href="../log4r/rdoc/GDC.html">GDC</a></li>
|
129
|
+
|
130
|
+
<li class="file"><a href="../log4r/rdoc/MDC.html">MDC</a></li>
|
131
|
+
|
132
|
+
<li class="file"><a href="../log4r/rdoc/NDC.html">NDC</a></li>
|
133
|
+
|
134
|
+
<li class="file"><a href="../log4r/rdoc/configurator.html">configurator</a></li>
|
135
|
+
|
136
|
+
<li class="file"><a href="../log4r/rdoc/emailoutputter.html">emailoutputter</a></li>
|
137
|
+
|
138
|
+
<li class="file"><a href="../log4r/rdoc/formatter.html">formatter</a></li>
|
139
|
+
|
140
|
+
<li class="file"><a href="../log4r/rdoc/log4r.html">log4r</a></li>
|
141
|
+
|
142
|
+
<li class="file"><a href="../log4r/rdoc/logger.html">logger</a></li>
|
143
|
+
|
144
|
+
<li class="file"><a href="../log4r/rdoc/logserver.html">logserver</a></li>
|
145
|
+
|
146
|
+
<li class="file"><a href="../log4r/rdoc/outputter.html">outputter</a></li>
|
147
|
+
|
148
|
+
<li class="file"><a href="../log4r/rdoc/patternformatter.html">patternformatter</a></li>
|
149
|
+
|
150
|
+
<li class="file"><a href="../log4r/rdoc/syslogoutputter.html">syslogoutputter</a></li>
|
151
|
+
|
152
|
+
<li class="file"><a href="../log4r/rdoc/win32eventoutputter.html">win32eventoutputter</a></li>
|
153
|
+
|
154
|
+
<li class="file"><a href="../log4r/rdoc/yamlconfigurator.html">yamlconfigurator</a></li>
|
155
|
+
|
156
|
+
</ul>
|
157
|
+
</div>
|
158
|
+
|
159
|
+
|
160
|
+
<div id="classindex-section" class="section project-section">
|
161
|
+
<h3 class="section-header">Class Index
|
162
|
+
<span class="search-toggle"><img src="../images/find.png"
|
163
|
+
height="16" width="16" alt="[+]"
|
164
|
+
title="show/hide quicksearch" /></span></h3>
|
165
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
166
|
+
<fieldset>
|
167
|
+
<legend>Quicksearch</legend>
|
168
|
+
<input type="text" name="quicksearch" value=""
|
169
|
+
class="quicksearch-field" />
|
170
|
+
</fieldset>
|
171
|
+
</form>
|
172
|
+
|
173
|
+
<ul class="link-list">
|
174
|
+
|
175
|
+
<li><a href="../Log4r.html">Log4r</a></li>
|
176
|
+
|
177
|
+
<li><a href="../Log4r/BasicFormatter.html">Log4r::BasicFormatter</a></li>
|
178
|
+
|
179
|
+
<li><a href="../Log4r/ConfigError.html">Log4r::ConfigError</a></li>
|
180
|
+
|
181
|
+
<li><a href="../Log4r/Configurator.html">Log4r::Configurator</a></li>
|
182
|
+
|
183
|
+
<li><a href="../Log4r/DateFileOutputter.html">Log4r::DateFileOutputter</a></li>
|
184
|
+
|
185
|
+
<li><a href="../Log4r/DefaultFormatter.html">Log4r::DefaultFormatter</a></li>
|
186
|
+
|
187
|
+
<li><a href="../Log4r/EmailOutputter.html">Log4r::EmailOutputter</a></li>
|
188
|
+
|
189
|
+
<li><a href="../Log4r/FileOutputter.html">Log4r::FileOutputter</a></li>
|
190
|
+
|
191
|
+
<li><a href="../Log4r/Formatter.html">Log4r::Formatter</a></li>
|
192
|
+
|
193
|
+
<li><a href="../Log4r/GDC.html">Log4r::GDC</a></li>
|
194
|
+
|
195
|
+
<li><a href="../Log4r/IOOutputter.html">Log4r::IOOutputter</a></li>
|
196
|
+
|
197
|
+
<li><a href="../Log4r/Log4jXmlFormatter.html">Log4r::Log4jXmlFormatter</a></li>
|
198
|
+
|
199
|
+
<li><a href="../Log4r/Log4rTools.html">Log4r::Log4rTools</a></li>
|
200
|
+
|
201
|
+
<li><a href="../Log4r/LogEvent.html">Log4r::LogEvent</a></li>
|
202
|
+
|
203
|
+
<li><a href="../Log4r/LogServer.html">Log4r::LogServer</a></li>
|
204
|
+
|
205
|
+
<li><a href="../Log4r/Logger.html">Log4r::Logger</a></li>
|
206
|
+
|
207
|
+
<li><a href="../Log4r/MDC.html">Log4r::MDC</a></li>
|
208
|
+
|
209
|
+
<li><a href="../Log4r/NDC.html">Log4r::NDC</a></li>
|
210
|
+
|
211
|
+
<li><a href="../Log4r/ObjectFormatter.html">Log4r::ObjectFormatter</a></li>
|
212
|
+
|
213
|
+
<li><a href="../Log4r/Outputter.html">Log4r::Outputter</a></li>
|
214
|
+
|
215
|
+
<li><a href="../Log4r/PatternFormatter.html">Log4r::PatternFormatter</a></li>
|
216
|
+
|
217
|
+
<li><a href="../Log4r/RemoteOutputter.html">Log4r::RemoteOutputter</a></li>
|
218
|
+
|
219
|
+
<li><a href="../Log4r/RollingFileOutputter.html">Log4r::RollingFileOutputter</a></li>
|
220
|
+
|
221
|
+
<li><a href="../Log4r/RootLogger.html">Log4r::RootLogger</a></li>
|
222
|
+
|
223
|
+
<li><a href="../Log4r/SimpleFormatter.html">Log4r::SimpleFormatter</a></li>
|
224
|
+
|
225
|
+
<li><a href="../Log4r/StderrOutputter.html">Log4r::StderrOutputter</a></li>
|
226
|
+
|
227
|
+
<li><a href="../Log4r/StdoutOutputter.html">Log4r::StdoutOutputter</a></li>
|
228
|
+
|
229
|
+
<li><a href="../Log4r/SyslogOutputter.html">Log4r::SyslogOutputter</a></li>
|
230
|
+
|
231
|
+
<li><a href="../Log4r/UDPOutputter.html">Log4r::UDPOutputter</a></li>
|
232
|
+
|
233
|
+
<li><a href="../Log4r/YamlConfigurator.html">Log4r::YamlConfigurator</a></li>
|
234
|
+
|
235
|
+
</ul>
|
236
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
237
|
+
</div>
|
238
|
+
|
239
|
+
|
240
|
+
</div>
|
241
|
+
</div>
|
242
|
+
|
243
|
+
<div id="documentation">
|
244
|
+
<h1 class="class">Log4r::Configurator</h1>
|
245
|
+
|
246
|
+
<div id="description">
|
247
|
+
<p>
|
248
|
+
See <a href="../log4r/configurator_rb.html">log4r/configurator.rb</a>
|
249
|
+
</p>
|
250
|
+
|
251
|
+
</div>
|
252
|
+
|
253
|
+
<!-- Constants -->
|
254
|
+
|
255
|
+
<div id="constants-list" class="section">
|
256
|
+
<h3 class="section-header">Constants</h3>
|
257
|
+
<dl>
|
258
|
+
|
259
|
+
<dt><a name="ExcludeParams">ExcludeParams</a></dt>
|
260
|
+
|
261
|
+
<dd class="description missing-docs">(Not documented)</dd>
|
262
|
+
|
263
|
+
|
264
|
+
</dl>
|
265
|
+
</div>
|
266
|
+
|
267
|
+
|
268
|
+
<!-- Attributes -->
|
269
|
+
|
270
|
+
|
271
|
+
<!-- Methods -->
|
272
|
+
|
273
|
+
<div id="public-class-method-details" class="method-section section">
|
274
|
+
<h3 class="section-header">Public Class Methods</h3>
|
275
|
+
|
276
|
+
|
277
|
+
<div id="--method" class="method-detail ">
|
278
|
+
<a name="M000009"></a>
|
279
|
+
|
280
|
+
<div class="method-heading">
|
281
|
+
|
282
|
+
<span class="method-name">[]</span><span
|
283
|
+
class="method-args">(param)</span>
|
284
|
+
<span class="method-click-advice">click to toggle source</span>
|
285
|
+
|
286
|
+
</div>
|
287
|
+
|
288
|
+
<div class="method-description">
|
289
|
+
|
290
|
+
<p>
|
291
|
+
Get a parameter’s value
|
292
|
+
</p>
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
<div class="method-source-code"
|
297
|
+
id="--source">
|
298
|
+
<pre>
|
299
|
+
<span class="ruby-comment cmt"># File log4r/configurator.rb, line 25</span>
|
300
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-operator">[]</span>(<span class="ruby-identifier">param</span>); <span class="ruby-ivar">@@params</span>[<span class="ruby-identifier">param</span>] <span class="ruby-keyword kw">end</span></pre>
|
301
|
+
</div>
|
302
|
+
|
303
|
+
</div>
|
304
|
+
|
305
|
+
|
306
|
+
</div>
|
307
|
+
|
308
|
+
|
309
|
+
<div id="--method" class="method-detail ">
|
310
|
+
<a name="M000010"></a>
|
311
|
+
|
312
|
+
<div class="method-heading">
|
313
|
+
|
314
|
+
<span class="method-name">[]=</span><span
|
315
|
+
class="method-args">(param, value)</span>
|
316
|
+
<span class="method-click-advice">click to toggle source</span>
|
317
|
+
|
318
|
+
</div>
|
319
|
+
|
320
|
+
<div class="method-description">
|
321
|
+
|
322
|
+
<p>
|
323
|
+
Define a parameter with a value
|
324
|
+
</p>
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
<div class="method-source-code"
|
329
|
+
id="--source">
|
330
|
+
<pre>
|
331
|
+
<span class="ruby-comment cmt"># File log4r/configurator.rb, line 27</span>
|
332
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-operator">[]=</span>(<span class="ruby-identifier">param</span>, <span class="ruby-identifier">value</span>); <span class="ruby-ivar">@@params</span>[<span class="ruby-identifier">param</span>] = <span class="ruby-identifier">value</span> <span class="ruby-keyword kw">end</span></pre>
|
333
|
+
</div>
|
334
|
+
|
335
|
+
</div>
|
336
|
+
|
337
|
+
|
338
|
+
</div>
|
339
|
+
|
340
|
+
|
341
|
+
<div id="custom-levels-method" class="method-detail ">
|
342
|
+
<a name="M000014"></a>
|
343
|
+
|
344
|
+
<div class="method-heading">
|
345
|
+
|
346
|
+
<span class="method-name">custom_levels</span><span
|
347
|
+
class="method-args">(*levels)</span>
|
348
|
+
<span class="method-click-advice">click to toggle source</span>
|
349
|
+
|
350
|
+
</div>
|
351
|
+
|
352
|
+
<div class="method-description">
|
353
|
+
|
354
|
+
<p>
|
355
|
+
Sets the custom levels. This method accepts symbols or strings.
|
356
|
+
</p>
|
357
|
+
<pre>
|
358
|
+
Configurator.custom_levels('My', 'Custom', :Levels)
|
359
|
+
</pre>
|
360
|
+
<p>
|
361
|
+
Alternatively, you can specify custom levels in XML:
|
362
|
+
</p>
|
363
|
+
<pre>
|
364
|
+
<log4r_config>
|
365
|
+
<pre_config>
|
366
|
+
<custom_levels>
|
367
|
+
My, Custom, Levels
|
368
|
+
</custom_levels>
|
369
|
+
...
|
370
|
+
</pre>
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
<div class="method-source-code"
|
375
|
+
id="custom-levels-source">
|
376
|
+
<pre>
|
377
|
+
<span class="ruby-comment cmt"># File log4r/configurator.rb, line 42</span>
|
378
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">custom_levels</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">levels</span>)
|
379
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">Logger</span>.<span class="ruby-identifier">root</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">levels</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
380
|
+
<span class="ruby-keyword kw">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword kw">in</span> <span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">levels</span>.<span class="ruby-identifier">size</span>
|
381
|
+
<span class="ruby-identifier">name</span> = <span class="ruby-identifier">levels</span>[<span class="ruby-identifier">i</span>].<span class="ruby-identifier">to_s</span>
|
382
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\s/</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/^[A-Z]/</span>
|
383
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-node">"#{name} is not a valid Ruby Constant name"</span>, <span class="ruby-identifier">caller</span>
|
384
|
+
<span class="ruby-keyword kw">end</span>
|
385
|
+
<span class="ruby-keyword kw">end</span>
|
386
|
+
<span class="ruby-constant">Log4r</span>.<span class="ruby-identifier">define_levels</span> <span class="ruby-operator">*</span><span class="ruby-identifier">levels</span>
|
387
|
+
<span class="ruby-keyword kw">end</span></pre>
|
388
|
+
</div>
|
389
|
+
|
390
|
+
</div>
|
391
|
+
|
392
|
+
|
393
|
+
</div>
|
394
|
+
|
395
|
+
|
396
|
+
<div id="load-xml-file-method" class="method-detail ">
|
397
|
+
<a name="M000015"></a>
|
398
|
+
|
399
|
+
<div class="method-heading">
|
400
|
+
|
401
|
+
<span class="method-name">load_xml_file</span><span
|
402
|
+
class="method-args">(filename)</span>
|
403
|
+
<span class="method-click-advice">click to toggle source</span>
|
404
|
+
|
405
|
+
</div>
|
406
|
+
|
407
|
+
<div class="method-description">
|
408
|
+
|
409
|
+
<p>
|
410
|
+
Given a filename, loads the XML configuration for <a
|
411
|
+
href="../Log4r.html">Log4r</a>.
|
412
|
+
</p>
|
413
|
+
|
414
|
+
|
415
|
+
|
416
|
+
<div class="method-source-code"
|
417
|
+
id="load-xml-file-source">
|
418
|
+
<pre>
|
419
|
+
<span class="ruby-comment cmt"># File log4r/configurator.rb, line 54</span>
|
420
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load_xml_file</span>(<span class="ruby-identifier">filename</span>)
|
421
|
+
<span class="ruby-identifier">detect_rexml</span>
|
422
|
+
<span class="ruby-identifier">actual_load</span> <span class="ruby-constant">Document</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">filename</span>))
|
423
|
+
<span class="ruby-keyword kw">end</span></pre>
|
424
|
+
</div>
|
425
|
+
|
426
|
+
</div>
|
427
|
+
|
428
|
+
|
429
|
+
</div>
|
430
|
+
|
431
|
+
|
432
|
+
<div id="load-xml-string-method" class="method-detail ">
|
433
|
+
<a name="M000016"></a>
|
434
|
+
|
435
|
+
<div class="method-heading">
|
436
|
+
|
437
|
+
<span class="method-name">load_xml_string</span><span
|
438
|
+
class="method-args">(string)</span>
|
439
|
+
<span class="method-click-advice">click to toggle source</span>
|
440
|
+
|
441
|
+
</div>
|
442
|
+
|
443
|
+
<div class="method-description">
|
444
|
+
|
445
|
+
<p>
|
446
|
+
You can load a String XML configuration instead of a file.
|
447
|
+
</p>
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
<div class="method-source-code"
|
452
|
+
id="load-xml-string-source">
|
453
|
+
<pre>
|
454
|
+
<span class="ruby-comment cmt"># File log4r/configurator.rb, line 60</span>
|
455
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load_xml_string</span>(<span class="ruby-identifier">string</span>)
|
456
|
+
<span class="ruby-identifier">detect_rexml</span>
|
457
|
+
<span class="ruby-identifier">actual_load</span> <span class="ruby-constant">Document</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">string</span>)
|
458
|
+
<span class="ruby-keyword kw">end</span></pre>
|
459
|
+
</div>
|
460
|
+
|
461
|
+
</div>
|
462
|
+
|
463
|
+
|
464
|
+
</div>
|
465
|
+
|
466
|
+
|
467
|
+
</div>
|
468
|
+
|
469
|
+
<div id="private-class-method-details" class="method-section section">
|
470
|
+
<h3 class="section-header">Private Class Methods</h3>
|
471
|
+
|
472
|
+
|
473
|
+
<div id="actual-load-method" class="method-detail ">
|
474
|
+
<a name="M000018"></a>
|
475
|
+
|
476
|
+
<div class="method-heading">
|
477
|
+
|
478
|
+
<span class="method-name">actual_load</span><span
|
479
|
+
class="method-args">(doc)</span>
|
480
|
+
<span class="method-click-advice">click to toggle source</span>
|
481
|
+
|
482
|
+
</div>
|
483
|
+
|
484
|
+
<div class="method-description">
|
485
|
+
|
486
|
+
<p class="missing-docs">(Not documented)</p>
|
487
|
+
|
488
|
+
|
489
|
+
|
490
|
+
<div class="method-source-code"
|
491
|
+
id="actual-load-source">
|
492
|
+
<pre>
|
493
|
+
<span class="ruby-comment cmt"># File log4r/configurator.rb, line 76</span>
|
494
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">actual_load</span>(<span class="ruby-identifier">doc</span>)
|
495
|
+
<span class="ruby-identifier">confignode</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">'//log4r_config'</span>]
|
496
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">confignode</span>.<span class="ruby-identifier">nil?</span>
|
497
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ConfigError</span>,
|
498
|
+
<span class="ruby-value str">"<log4r_config> element not defined"</span>, <span class="ruby-identifier">caller</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
|
499
|
+
<span class="ruby-keyword kw">end</span>
|
500
|
+
<span class="ruby-identifier">decode_xml</span>(<span class="ruby-identifier">confignode</span>)
|
501
|
+
<span class="ruby-keyword kw">end</span></pre>
|
502
|
+
</div>
|
503
|
+
|
504
|
+
</div>
|
505
|
+
|
506
|
+
|
507
|
+
</div>
|
508
|
+
|
509
|
+
|
510
|
+
<div id="decode-custom-levels-method" class="method-detail ">
|
511
|
+
<a name="M000022"></a>
|
512
|
+
|
513
|
+
<div class="method-heading">
|
514
|
+
|
515
|
+
<span class="method-name">decode_custom_levels</span><span
|
516
|
+
class="method-args">(e)</span>
|
517
|
+
<span class="method-click-advice">click to toggle source</span>
|
518
|
+
|
519
|
+
</div>
|
520
|
+
|
521
|
+
<div class="method-description">
|
522
|
+
|
523
|
+
<p class="missing-docs">(Not documented)</p>
|
524
|
+
|
525
|
+
|
526
|
+
|
527
|
+
<div class="method-source-code"
|
528
|
+
id="decode-custom-levels-source">
|
529
|
+
<pre>
|
530
|
+
<span class="ruby-comment cmt"># File log4r/configurator.rb, line 101</span>
|
531
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decode_custom_levels</span>(<span class="ruby-identifier">e</span>)
|
532
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">Logger</span>.<span class="ruby-identifier">root</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">text</span>.<span class="ruby-identifier">nil?</span>
|
533
|
+
<span class="ruby-keyword kw">begin</span> <span class="ruby-identifier">custom_levels</span> <span class="ruby-operator">*</span><span class="ruby-constant">Log4rTools</span>.<span class="ruby-identifier">comma_split</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">text</span>)
|
534
|
+
<span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">TypeError</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">te</span>
|
535
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ConfigError</span>, <span class="ruby-identifier">te</span>.<span class="ruby-identifier">message</span>, <span class="ruby-identifier">caller</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-4</span>]
|
536
|
+
<span class="ruby-keyword kw">end</span>
|
537
|
+
<span class="ruby-keyword kw">end</span></pre>
|
538
|
+
</div>
|
539
|
+
|
540
|
+
</div>
|
541
|
+
|
542
|
+
|
543
|
+
</div>
|
544
|
+
|
545
|
+
|
546
|
+
<div id="decode-formatter-method" class="method-detail ">
|
547
|
+
<a name="M000027"></a>
|
548
|
+
|
549
|
+
<div class="method-heading">
|
550
|
+
|
551
|
+
<span class="method-name">decode_formatter</span><span
|
552
|
+
class="method-args">(e)</span>
|
553
|
+
<span class="method-click-advice">click to toggle source</span>
|
554
|
+
|
555
|
+
</div>
|
556
|
+
|
557
|
+
<div class="method-description">
|
558
|
+
|
559
|
+
<p class="missing-docs">(Not documented)</p>
|
560
|
+
|
561
|
+
|
562
|
+
|
563
|
+
<div class="method-source-code"
|
564
|
+
id="decode-formatter-source">
|
565
|
+
<pre>
|
566
|
+
<span class="ruby-comment cmt"># File log4r/configurator.rb, line 160</span>
|
567
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decode_formatter</span>(<span class="ruby-identifier">e</span>)
|
568
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">nil?</span>
|
569
|
+
<span class="ruby-identifier">type</span> = <span class="ruby-identifier">e</span>.<span class="ruby-identifier">value_of</span> <span class="ruby-value str">'type'</span>
|
570
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ConfigError</span>, <span class="ruby-value str">"Formatter missing type"</span>, <span class="ruby-identifier">caller</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-4</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">type</span>.<span class="ruby-identifier">nil?</span>
|
571
|
+
<span class="ruby-identifier">buff</span> = <span class="ruby-node">"#{type}.new "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">decode_hash_params</span>(<span class="ruby-identifier">e</span>).<span class="ruby-identifier">join</span>(<span class="ruby-value str">','</span>)
|
572
|
+
<span class="ruby-keyword kw">begin</span> <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">eval</span>(<span class="ruby-identifier">buff</span>)
|
573
|
+
<span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">ae</span>
|
574
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ConfigError</span>,
|
575
|
+
<span class="ruby-node">"Problem creating outputter: #{ae.message}"</span>, <span class="ruby-identifier">caller</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-4</span>]
|
576
|
+
<span class="ruby-keyword kw">end</span>
|
577
|
+
<span class="ruby-keyword kw">end</span></pre>
|
578
|
+
</div>
|
579
|
+
|
580
|
+
</div>
|
581
|
+
|
582
|
+
|
583
|
+
</div>
|
584
|
+
|
585
|
+
|
586
|
+
<div id="decode-hash-params-method" class="method-detail ">
|
587
|
+
<a name="M000029"></a>
|
588
|
+
|
589
|
+
<div class="method-heading">
|
590
|
+
|
591
|
+
<span class="method-name">decode_hash_params</span><span
|
592
|
+
class="method-args">(e)</span>
|
593
|
+
<span class="method-click-advice">click to toggle source</span>
|
594
|
+
|
595
|
+
</div>
|
596
|
+
|
597
|
+
<div class="method-description">
|
598
|
+
|
599
|
+
<p>
|
600
|
+
Does the fancy parameter to hash argument transformation
|
601
|
+
</p>
|
602
|
+
|
603
|
+
|
604
|
+
|
605
|
+
<div class="method-source-code"
|
606
|
+
id="decode-hash-params-source">
|
607
|
+
<pre>
|
608
|
+
<span class="ruby-comment cmt"># File log4r/configurator.rb, line 175</span>
|
609
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decode_hash_params</span>(<span class="ruby-identifier">e</span>)
|
610
|
+
<span class="ruby-identifier">buff</span> = []
|
611
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">attributes</span>.<span class="ruby-identifier">each_attribute</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span>
|
612
|
+
<span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ExcludeParams</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">name</span>
|
613
|
+
<span class="ruby-identifier">buff</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">":"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"=>"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">paramsub</span>(<span class="ruby-identifier">p</span>.<span class="ruby-identifier">value</span>)
|
614
|
+
}
|
615
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">elements</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span>
|
616
|
+
<span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ExcludeParams</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">name</span>
|
617
|
+
<span class="ruby-identifier">buff</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">":"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"=>"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">paramsub</span>(<span class="ruby-identifier">p</span>.<span class="ruby-identifier">text</span>)
|
618
|
+
}
|
619
|
+
<span class="ruby-identifier">buff</span>
|
620
|
+
<span class="ruby-keyword kw">end</span></pre>
|
621
|
+
</div>
|
622
|
+
|
623
|
+
</div>
|
624
|
+
|
625
|
+
|
626
|
+
</div>
|
627
|
+
|
628
|
+
|
629
|
+
<div id="decode-logger-method" class="method-detail ">
|
630
|
+
<a name="M000031"></a>
|
631
|
+
|
632
|
+
<div class="method-heading">
|
633
|
+
|
634
|
+
<span class="method-name">decode_logger</span><span
|
635
|
+
class="method-args">(e)</span>
|
636
|
+
<span class="method-click-advice">click to toggle source</span>
|
637
|
+
|
638
|
+
</div>
|
639
|
+
|
640
|
+
<div class="method-description">
|
641
|
+
|
642
|
+
<p class="missing-docs">(Not documented)</p>
|
643
|
+
|
644
|
+
|
645
|
+
|
646
|
+
<div class="method-source-code"
|
647
|
+
id="decode-logger-source">
|
648
|
+
<pre>
|
649
|
+
<span class="ruby-comment cmt"># File log4r/configurator.rb, line 195</span>
|
650
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decode_logger</span>(<span class="ruby-identifier">e</span>)
|
651
|
+
<span class="ruby-identifier">l</span> = <span class="ruby-constant">Logger</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">value_of</span>(<span class="ruby-value str">'name'</span>)
|
652
|
+
<span class="ruby-identifier">decode_logger_common</span>(<span class="ruby-identifier">l</span>, <span class="ruby-identifier">e</span>)
|
653
|
+
<span class="ruby-keyword kw">end</span></pre>
|
654
|
+
</div>
|
655
|
+
|
656
|
+
</div>
|
657
|
+
|
658
|
+
|
659
|
+
</div>
|
660
|
+
|
661
|
+
|
662
|
+
<div id="decode-logger-common-method" class="method-detail ">
|
663
|
+
<a name="M000034"></a>
|
664
|
+
|
665
|
+
<div class="method-heading">
|
666
|
+
|
667
|
+
<span class="method-name">decode_logger_common</span><span
|
668
|
+
class="method-args">(l, e)</span>
|
669
|
+
<span class="method-click-advice">click to toggle source</span>
|
670
|
+
|
671
|
+
</div>
|
672
|
+
|
673
|
+
<div class="method-description">
|
674
|
+
|
675
|
+
<p class="missing-docs">(Not documented)</p>
|
676
|
+
|
677
|
+
|
678
|
+
|
679
|
+
<div class="method-source-code"
|
680
|
+
id="decode-logger-common-source">
|
681
|
+
<pre>
|
682
|
+
<span class="ruby-comment cmt"># File log4r/configurator.rb, line 208</span>
|
683
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decode_logger_common</span>(<span class="ruby-identifier">l</span>, <span class="ruby-identifier">e</span>)
|
684
|
+
<span class="ruby-identifier">level</span> = <span class="ruby-identifier">e</span>.<span class="ruby-identifier">value_of</span> <span class="ruby-value str">'level'</span>
|
685
|
+
<span class="ruby-identifier">additive</span> = <span class="ruby-identifier">e</span>.<span class="ruby-identifier">value_of</span> <span class="ruby-value str">'additive'</span>
|
686
|
+
<span class="ruby-identifier">trace</span> = <span class="ruby-identifier">e</span>.<span class="ruby-identifier">value_of</span> <span class="ruby-value str">'trace'</span>
|
687
|
+
<span class="ruby-identifier">l</span>.<span class="ruby-identifier">level</span> = <span class="ruby-constant">LNAMES</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">level</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">level</span>.<span class="ruby-identifier">nil?</span>
|
688
|
+
<span class="ruby-identifier">l</span>.<span class="ruby-identifier">additive</span> = <span class="ruby-identifier">additive</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">additive</span>.<span class="ruby-identifier">nil?</span>
|
689
|
+
<span class="ruby-identifier">l</span>.<span class="ruby-identifier">trace</span> = <span class="ruby-identifier">trace</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">trace</span>.<span class="ruby-identifier">nil?</span>
|
690
|
+
<span class="ruby-comment cmt"># and now for outputters</span>
|
691
|
+
<span class="ruby-identifier">outs</span> = <span class="ruby-identifier">e</span>.<span class="ruby-identifier">value_of</span> <span class="ruby-value str">'outputters'</span>
|
692
|
+
<span class="ruby-constant">Log4rTools</span>.<span class="ruby-identifier">comma_split</span>(<span class="ruby-identifier">outs</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">add</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">strip</span>} <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">outs</span>.<span class="ruby-identifier">nil?</span>
|
693
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">elements</span>.<span class="ruby-identifier">each</span>(<span class="ruby-value str">'outputter'</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span>
|
694
|
+
<span class="ruby-identifier">name</span> = (<span class="ruby-identifier">e</span>.<span class="ruby-identifier">value_of</span> <span class="ruby-value str">'name'</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">text</span>)
|
695
|
+
<span class="ruby-identifier">l</span>.<span class="ruby-identifier">add</span> <span class="ruby-constant">Outputter</span>[<span class="ruby-identifier">name</span>]
|
696
|
+
}
|
697
|
+
<span class="ruby-keyword kw">end</span></pre>
|
698
|
+
</div>
|
699
|
+
|
700
|
+
</div>
|
701
|
+
|
702
|
+
|
703
|
+
</div>
|
704
|
+
|
705
|
+
|
706
|
+
<div id="decode-logserver-method" class="method-detail ">
|
707
|
+
<a name="M000033"></a>
|
708
|
+
|
709
|
+
<div class="method-heading">
|
710
|
+
|
711
|
+
<span class="method-name">decode_logserver</span><span
|
712
|
+
class="method-args">(e)</span>
|
713
|
+
<span class="method-click-advice">click to toggle source</span>
|
714
|
+
|
715
|
+
</div>
|
716
|
+
|
717
|
+
<div class="method-description">
|
718
|
+
|
719
|
+
<p class="missing-docs">(Not documented)</p>
|
720
|
+
|
721
|
+
|
722
|
+
|
723
|
+
<div class="method-source-code"
|
724
|
+
id="decode-logserver-source">
|
725
|
+
<pre>
|
726
|
+
<span class="ruby-comment cmt"># File log4r/configurator.rb, line 200</span>
|
727
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decode_logserver</span>(<span class="ruby-identifier">e</span>)
|
728
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">HAVE_REXML</span>
|
729
|
+
<span class="ruby-identifier">name</span> = <span class="ruby-identifier">e</span>.<span class="ruby-identifier">value_of</span> <span class="ruby-value str">'name'</span>
|
730
|
+
<span class="ruby-identifier">uri</span> = <span class="ruby-identifier">e</span>.<span class="ruby-identifier">value_of</span> <span class="ruby-value str">'uri'</span>
|
731
|
+
<span class="ruby-identifier">l</span> = <span class="ruby-constant">LogServer</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">uri</span>
|
732
|
+
<span class="ruby-identifier">decode_logger_common</span>(<span class="ruby-identifier">l</span>, <span class="ruby-identifier">e</span>)
|
733
|
+
<span class="ruby-keyword kw">end</span></pre>
|
734
|
+
</div>
|
735
|
+
|
736
|
+
</div>
|
737
|
+
|
738
|
+
|
739
|
+
</div>
|
740
|
+
|
741
|
+
|
742
|
+
<div id="decode-outputter-method" class="method-detail ">
|
743
|
+
<a name="M000026"></a>
|
744
|
+
|
745
|
+
<div class="method-heading">
|
746
|
+
|
747
|
+
<span class="method-name">decode_outputter</span><span
|
748
|
+
class="method-args">(e)</span>
|
749
|
+
<span class="method-click-advice">click to toggle source</span>
|
750
|
+
|
751
|
+
</div>
|
752
|
+
|
753
|
+
<div class="method-description">
|
754
|
+
|
755
|
+
<p class="missing-docs">(Not documented)</p>
|
756
|
+
|
757
|
+
|
758
|
+
|
759
|
+
<div class="method-source-code"
|
760
|
+
id="decode-outputter-source">
|
761
|
+
<pre>
|
762
|
+
<span class="ruby-comment cmt"># File log4r/configurator.rb, line 126</span>
|
763
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decode_outputter</span>(<span class="ruby-identifier">e</span>)
|
764
|
+
<span class="ruby-comment cmt"># fields</span>
|
765
|
+
<span class="ruby-identifier">name</span> = <span class="ruby-identifier">e</span>.<span class="ruby-identifier">value_of</span> <span class="ruby-value str">'name'</span>
|
766
|
+
<span class="ruby-identifier">type</span> = <span class="ruby-identifier">e</span>.<span class="ruby-identifier">value_of</span> <span class="ruby-value str">'type'</span>
|
767
|
+
<span class="ruby-identifier">level</span> = <span class="ruby-identifier">e</span>.<span class="ruby-identifier">value_of</span> <span class="ruby-value str">'level'</span>
|
768
|
+
<span class="ruby-identifier">only_at</span> = <span class="ruby-identifier">e</span>.<span class="ruby-identifier">value_of</span> <span class="ruby-value str">'only_at'</span>
|
769
|
+
<span class="ruby-comment cmt"># validation</span>
|
770
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ConfigError</span>, <span class="ruby-value str">"Outputter missing name"</span>, <span class="ruby-identifier">caller</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-3</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">nil?</span>
|
771
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ConfigError</span>, <span class="ruby-value str">"Outputter missing type"</span>, <span class="ruby-identifier">caller</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-3</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">type</span>.<span class="ruby-identifier">nil?</span>
|
772
|
+
<span class="ruby-constant">Log4rTools</span>.<span class="ruby-identifier">validate_level</span>(<span class="ruby-constant">LNAMES</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">level</span>)) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">level</span>.<span class="ruby-identifier">nil?</span>
|
773
|
+
<span class="ruby-identifier">only_levels</span> = []
|
774
|
+
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">only_at</span>.<span class="ruby-identifier">nil?</span>
|
775
|
+
<span class="ruby-keyword kw">for</span> <span class="ruby-identifier">lev</span> <span class="ruby-keyword kw">in</span> <span class="ruby-constant">Log4rTools</span>.<span class="ruby-identifier">comma_split</span>(<span class="ruby-identifier">only_at</span>)
|
776
|
+
<span class="ruby-identifier">alev</span> = <span class="ruby-constant">LNAMES</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">lev</span>)
|
777
|
+
<span class="ruby-constant">Log4rTools</span>.<span class="ruby-identifier">validate_level</span>(<span class="ruby-identifier">alev</span>, <span class="ruby-value">3</span>)
|
778
|
+
<span class="ruby-identifier">only_levels</span>.<span class="ruby-identifier">push</span> <span class="ruby-identifier">alev</span>
|
779
|
+
<span class="ruby-keyword kw">end</span>
|
780
|
+
<span class="ruby-keyword kw">end</span>
|
781
|
+
<span class="ruby-identifier">formatter</span> = <span class="ruby-identifier">decode_formatter</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">'formatter'</span>])
|
782
|
+
<span class="ruby-comment cmt"># build the eval string</span>
|
783
|
+
<span class="ruby-identifier">buff</span> = <span class="ruby-node">"Outputter[name] = #{type}.new name"</span>
|
784
|
+
<span class="ruby-identifier">buff</span> <span class="ruby-operator">+=</span> <span class="ruby-node">",:level=>#{LNAMES.index(level)}"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">level</span>.<span class="ruby-identifier">nil?</span>
|
785
|
+
<span class="ruby-identifier">buff</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">",:formatter=>formatter"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">nil?</span>
|
786
|
+
<span class="ruby-identifier">params</span> = <span class="ruby-identifier">decode_hash_params</span>(<span class="ruby-identifier">e</span>)
|
787
|
+
<span class="ruby-identifier">buff</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">","</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">params</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">','</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">params</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
788
|
+
<span class="ruby-keyword kw">begin</span> <span class="ruby-identifier">eval</span> <span class="ruby-identifier">buff</span>
|
789
|
+
<span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">ae</span>
|
790
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ConfigError</span>,
|
791
|
+
<span class="ruby-node">"Problem creating outputter: #{ae.message}"</span>, <span class="ruby-identifier">caller</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-3</span>]
|
792
|
+
<span class="ruby-keyword kw">end</span>
|
793
|
+
<span class="ruby-constant">Outputter</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">only_at</span> <span class="ruby-operator">*</span><span class="ruby-identifier">only_levels</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">only_levels</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
794
|
+
<span class="ruby-constant">Outputter</span>[<span class="ruby-identifier">name</span>]
|
795
|
+
<span class="ruby-keyword kw">end</span></pre>
|
796
|
+
</div>
|
797
|
+
|
798
|
+
</div>
|
799
|
+
|
800
|
+
|
801
|
+
</div>
|
802
|
+
|
803
|
+
|
804
|
+
<div id="decode-parameter-method" class="method-detail ">
|
805
|
+
<a name="M000025"></a>
|
806
|
+
|
807
|
+
<div class="method-heading">
|
808
|
+
|
809
|
+
<span class="method-name">decode_parameter</span><span
|
810
|
+
class="method-args">(e)</span>
|
811
|
+
<span class="method-click-advice">click to toggle source</span>
|
812
|
+
|
813
|
+
</div>
|
814
|
+
|
815
|
+
<div class="method-description">
|
816
|
+
|
817
|
+
<p class="missing-docs">(Not documented)</p>
|
818
|
+
|
819
|
+
|
820
|
+
|
821
|
+
<div class="method-source-code"
|
822
|
+
id="decode-parameter-source">
|
823
|
+
<pre>
|
824
|
+
<span class="ruby-comment cmt"># File log4r/configurator.rb, line 122</span>
|
825
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decode_parameter</span>(<span class="ruby-identifier">e</span>)
|
826
|
+
<span class="ruby-ivar">@@params</span>[<span class="ruby-identifier">e</span>.<span class="ruby-identifier">value_of</span>(<span class="ruby-value str">'name'</span>)] = <span class="ruby-identifier">e</span>.<span class="ruby-identifier">value_of</span> <span class="ruby-value str">'value'</span>
|
827
|
+
<span class="ruby-keyword kw">end</span></pre>
|
828
|
+
</div>
|
829
|
+
|
830
|
+
</div>
|
831
|
+
|
832
|
+
|
833
|
+
</div>
|
834
|
+
|
835
|
+
|
836
|
+
<div id="decode-parameters-method" class="method-detail ">
|
837
|
+
<a name="M000024"></a>
|
838
|
+
|
839
|
+
<div class="method-heading">
|
840
|
+
|
841
|
+
<span class="method-name">decode_parameters</span><span
|
842
|
+
class="method-args">(e)</span>
|
843
|
+
<span class="method-click-advice">click to toggle source</span>
|
844
|
+
|
845
|
+
</div>
|
846
|
+
|
847
|
+
<div class="method-description">
|
848
|
+
|
849
|
+
<p class="missing-docs">(Not documented)</p>
|
850
|
+
|
851
|
+
|
852
|
+
|
853
|
+
<div class="method-source-code"
|
854
|
+
id="decode-parameters-source">
|
855
|
+
<pre>
|
856
|
+
<span class="ruby-comment cmt"># File log4r/configurator.rb, line 118</span>
|
857
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decode_parameters</span>(<span class="ruby-identifier">e</span>)
|
858
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">elements</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@@params</span>[<span class="ruby-identifier">p</span>.<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">p</span>.<span class="ruby-identifier">text</span>} <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">nil?</span>
|
859
|
+
<span class="ruby-keyword kw">end</span></pre>
|
860
|
+
</div>
|
861
|
+
|
862
|
+
</div>
|
863
|
+
|
864
|
+
|
865
|
+
</div>
|
866
|
+
|
867
|
+
|
868
|
+
<div id="decode-pre-config-method" class="method-detail ">
|
869
|
+
<a name="M000021"></a>
|
870
|
+
|
871
|
+
<div class="method-heading">
|
872
|
+
|
873
|
+
<span class="method-name">decode_pre_config</span><span
|
874
|
+
class="method-args">(e)</span>
|
875
|
+
<span class="method-click-advice">click to toggle source</span>
|
876
|
+
|
877
|
+
</div>
|
878
|
+
|
879
|
+
<div class="method-description">
|
880
|
+
|
881
|
+
<p class="missing-docs">(Not documented)</p>
|
882
|
+
|
883
|
+
|
884
|
+
|
885
|
+
<div class="method-source-code"
|
886
|
+
id="decode-pre-config-source">
|
887
|
+
<pre>
|
888
|
+
<span class="ruby-comment cmt"># File log4r/configurator.rb, line 92</span>
|
889
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decode_pre_config</span>(<span class="ruby-identifier">e</span>)
|
890
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">Logger</span>.<span class="ruby-identifier">root</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">nil?</span>
|
891
|
+
<span class="ruby-identifier">decode_custom_levels</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">'custom_levels'</span>])
|
892
|
+
<span class="ruby-identifier">global_config</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">'global'</span>])
|
893
|
+
<span class="ruby-identifier">global_config</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">'root'</span>])
|
894
|
+
<span class="ruby-identifier">decode_parameters</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">'parameters'</span>])
|
895
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">elements</span>.<span class="ruby-identifier">each</span>(<span class="ruby-value str">'parameter'</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-identifier">decode_parameter</span>(<span class="ruby-identifier">p</span>)}
|
896
|
+
<span class="ruby-keyword kw">end</span></pre>
|
897
|
+
</div>
|
898
|
+
|
899
|
+
</div>
|
900
|
+
|
901
|
+
|
902
|
+
</div>
|
903
|
+
|
904
|
+
|
905
|
+
<div id="decode-xml-method" class="method-detail ">
|
906
|
+
<a name="M000020"></a>
|
907
|
+
|
908
|
+
<div class="method-heading">
|
909
|
+
|
910
|
+
<span class="method-name">decode_xml</span><span
|
911
|
+
class="method-args">(doc)</span>
|
912
|
+
<span class="method-click-advice">click to toggle source</span>
|
913
|
+
|
914
|
+
</div>
|
915
|
+
|
916
|
+
<div class="method-description">
|
917
|
+
|
918
|
+
<p class="missing-docs">(Not documented)</p>
|
919
|
+
|
920
|
+
|
921
|
+
|
922
|
+
<div class="method-source-code"
|
923
|
+
id="decode-xml-source">
|
924
|
+
<pre>
|
925
|
+
<span class="ruby-comment cmt"># File log4r/configurator.rb, line 85</span>
|
926
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decode_xml</span>(<span class="ruby-identifier">doc</span>)
|
927
|
+
<span class="ruby-identifier">decode_pre_config</span>(<span class="ruby-identifier">doc</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">'pre_config'</span>])
|
928
|
+
<span class="ruby-identifier">doc</span>.<span class="ruby-identifier">elements</span>.<span class="ruby-identifier">each</span>(<span class="ruby-value str">'outputter'</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">decode_outputter</span>(<span class="ruby-identifier">e</span>)}
|
929
|
+
<span class="ruby-identifier">doc</span>.<span class="ruby-identifier">elements</span>.<span class="ruby-identifier">each</span>(<span class="ruby-value str">'logger'</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">decode_logger</span>(<span class="ruby-identifier">e</span>)}
|
930
|
+
<span class="ruby-identifier">doc</span>.<span class="ruby-identifier">elements</span>.<span class="ruby-identifier">each</span>(<span class="ruby-value str">'logserver'</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">decode_logserver</span>(<span class="ruby-identifier">e</span>)}
|
931
|
+
<span class="ruby-keyword kw">end</span></pre>
|
932
|
+
</div>
|
933
|
+
|
934
|
+
</div>
|
935
|
+
|
936
|
+
|
937
|
+
</div>
|
938
|
+
|
939
|
+
|
940
|
+
<div id="detect-rexml-method" class="method-detail ">
|
941
|
+
<a name="M000017"></a>
|
942
|
+
|
943
|
+
<div class="method-heading">
|
944
|
+
|
945
|
+
<span class="method-name">detect_rexml</span><span
|
946
|
+
class="method-args">()</span>
|
947
|
+
<span class="method-click-advice">click to toggle source</span>
|
948
|
+
|
949
|
+
</div>
|
950
|
+
|
951
|
+
<div class="method-description">
|
952
|
+
|
953
|
+
|
954
|
+
|
955
|
+
|
956
|
+
|
957
|
+
<div class="method-source-code"
|
958
|
+
id="detect-rexml-source">
|
959
|
+
<pre>
|
960
|
+
<span class="ruby-comment cmt"># File log4r/configurator.rb, line 69</span>
|
961
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">detect_rexml</span>
|
962
|
+
<span class="ruby-keyword kw">unless</span> <span class="ruby-constant">HAVE_REXML</span>
|
963
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">LoadError</span>,
|
964
|
+
<span class="ruby-value str">"Need REXML to load XML configuration"</span>, <span class="ruby-identifier">caller</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
|
965
|
+
<span class="ruby-keyword kw">end</span>
|
966
|
+
<span class="ruby-keyword kw">end</span></pre>
|
967
|
+
</div>
|
968
|
+
|
969
|
+
</div>
|
970
|
+
|
971
|
+
|
972
|
+
</div>
|
973
|
+
|
974
|
+
|
975
|
+
<div id="global-config-method" class="method-detail ">
|
976
|
+
<a name="M000023"></a>
|
977
|
+
|
978
|
+
<div class="method-heading">
|
979
|
+
|
980
|
+
<span class="method-name">global_config</span><span
|
981
|
+
class="method-args">(e)</span>
|
982
|
+
<span class="method-click-advice">click to toggle source</span>
|
983
|
+
|
984
|
+
</div>
|
985
|
+
|
986
|
+
<div class="method-description">
|
987
|
+
|
988
|
+
<p class="missing-docs">(Not documented)</p>
|
989
|
+
|
990
|
+
|
991
|
+
|
992
|
+
<div class="method-source-code"
|
993
|
+
id="global-config-source">
|
994
|
+
<pre>
|
995
|
+
<span class="ruby-comment cmt"># File log4r/configurator.rb, line 109</span>
|
996
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">global_config</span>(<span class="ruby-identifier">e</span>)
|
997
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">nil?</span>
|
998
|
+
<span class="ruby-identifier">globlev</span> = <span class="ruby-identifier">e</span>.<span class="ruby-identifier">value_of</span> <span class="ruby-value str">'level'</span>
|
999
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">globlev</span>.<span class="ruby-identifier">nil?</span>
|
1000
|
+
<span class="ruby-identifier">lev</span> = <span class="ruby-constant">LNAMES</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">globlev</span>) <span class="ruby-comment cmt"># find value in LNAMES</span>
|
1001
|
+
<span class="ruby-constant">Log4rTools</span>.<span class="ruby-identifier">validate_level</span>(<span class="ruby-identifier">lev</span>, <span class="ruby-value">4</span>) <span class="ruby-comment cmt"># choke on bad level</span>
|
1002
|
+
<span class="ruby-constant">Logger</span>.<span class="ruby-identifier">global</span>.<span class="ruby-identifier">level</span> = <span class="ruby-identifier">lev</span>
|
1003
|
+
<span class="ruby-keyword kw">end</span></pre>
|
1004
|
+
</div>
|
1005
|
+
|
1006
|
+
</div>
|
1007
|
+
|
1008
|
+
|
1009
|
+
</div>
|
1010
|
+
|
1011
|
+
|
1012
|
+
<div id="paramsub-method" class="method-detail ">
|
1013
|
+
<a name="M000030"></a>
|
1014
|
+
|
1015
|
+
<div class="method-heading">
|
1016
|
+
|
1017
|
+
<span class="method-name">paramsub</span><span
|
1018
|
+
class="method-args">(str)</span>
|
1019
|
+
<span class="method-click-advice">click to toggle source</span>
|
1020
|
+
|
1021
|
+
</div>
|
1022
|
+
|
1023
|
+
<div class="method-description">
|
1024
|
+
|
1025
|
+
<p>
|
1026
|
+
Substitues any #{foo} in the XML with Parameter[‘foo’]
|
1027
|
+
</p>
|
1028
|
+
|
1029
|
+
|
1030
|
+
|
1031
|
+
<div class="method-source-code"
|
1032
|
+
id="paramsub-source">
|
1033
|
+
<pre>
|
1034
|
+
<span class="ruby-comment cmt"># File log4r/configurator.rb, line 189</span>
|
1035
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">paramsub</span>(<span class="ruby-identifier">str</span>)
|
1036
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">str</span>.<span class="ruby-identifier">nil?</span>
|
1037
|
+
<span class="ruby-ivar">@@params</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">param</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span> <span class="ruby-identifier">str</span>.<span class="ruby-identifier">sub!</span> <span class="ruby-value str">'#{'</span><span class="ruby-operator">+</span><span class="ruby-identifier">param</span><span class="ruby-operator">+</span><span class="ruby-value str">'}'</span>, <span class="ruby-identifier">value</span>}
|
1038
|
+
<span class="ruby-value str">"'"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">str</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"'"</span>
|
1039
|
+
<span class="ruby-keyword kw">end</span></pre>
|
1040
|
+
</div>
|
1041
|
+
|
1042
|
+
</div>
|
1043
|
+
|
1044
|
+
|
1045
|
+
</div>
|
1046
|
+
|
1047
|
+
|
1048
|
+
</div>
|
1049
|
+
|
1050
|
+
|
1051
|
+
</div>
|
1052
|
+
|
1053
|
+
|
1054
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
1055
|
+
|
1056
|
+
<p>Disabled; run with --debug to generate this.</p>
|
1057
|
+
|
1058
|
+
</div>
|
1059
|
+
|
1060
|
+
<div id="validator-badges">
|
1061
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
1062
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
1063
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
1064
|
+
</div>
|
1065
|
+
|
1066
|
+
</body>
|
1067
|
+
</html>
|
1068
|
+
|