log4r 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README +3 -3
- data/Rakefile +3 -3
- data/doc/rdoc-log4r.css +696 -0
- data/examples/syslogcustom.rb +6 -1
- data/src/doc/Log4r.html +392 -0
- data/src/doc/Log4r/BasicFormatter.html +370 -0
- data/src/doc/Log4r/ConfigError.html +207 -0
- data/src/doc/Log4r/Configurator.html +1050 -0
- data/src/doc/Log4r/DateFileOutputter.html +454 -0
- data/src/doc/Log4r/DefaultFormatter.html +205 -0
- data/src/doc/Log4r/EmailOutputter.html +636 -0
- data/src/doc/Log4r/FileOutputter.html +321 -0
- data/src/doc/Log4r/Formatter.html +291 -0
- data/src/doc/Log4r/IOOutputter.html +392 -0
- data/src/doc/Log4r/Log4rConfig.html +193 -0
- data/src/doc/Log4r/Log4rTools.html +370 -0
- data/src/doc/Log4r/LogEvent.html +360 -0
- data/src/doc/Log4r/LogServer.html +322 -0
- data/src/doc/Log4r/Logger.html +1132 -0
- data/src/doc/Log4r/Logger/LoggerFactory.html +200 -0
- data/src/doc/Log4r/Logger/Repository.html +207 -0
- data/src/doc/Log4r/ObjectFormatter.html +262 -0
- data/src/doc/Log4r/Outputter.html +910 -0
- data/src/doc/Log4r/Outputter/OutputterFactory.html +200 -0
- data/src/doc/Log4r/Outputter/consoleoutputters_rb.html +57 -0
- data/src/doc/Log4r/Outputter/datefileoutputter_rb.html +93 -0
- data/src/doc/Log4r/Outputter/emailoutputter_rb.html +179 -0
- data/src/doc/Log4r/Outputter/fileoutputter_rb.html +64 -0
- data/src/doc/Log4r/Outputter/iooutputter_rb.html +59 -0
- data/src/doc/Log4r/Outputter/outputter_rb.html +222 -0
- data/src/doc/Log4r/Outputter/outputterfactory_rb.html +62 -0
- data/src/doc/Log4r/Outputter/remoteoutputter_rb.html +59 -0
- data/src/doc/Log4r/Outputter/rollingfileoutputter_rb.html +66 -0
- data/src/doc/Log4r/Outputter/staticoutputter_rb.html +55 -0
- data/src/doc/Log4r/Outputter/syslogoutputter_rb.html +110 -0
- data/src/doc/Log4r/Outputter/tst_rb.html +54 -0
- data/src/doc/Log4r/PatternFormatter.html +422 -0
- data/src/doc/Log4r/ROMPClient.html +193 -0
- data/src/doc/Log4r/ROMPServer.html +193 -0
- data/src/doc/Log4r/RemoteOutputter.html +384 -0
- data/src/doc/Log4r/RollingFileOutputter.html +528 -0
- data/src/doc/Log4r/RootLogger.html +512 -0
- data/src/doc/Log4r/SimpleFormatter.html +258 -0
- data/src/doc/Log4r/StderrOutputter.html +250 -0
- data/src/doc/Log4r/StdoutOutputter.html +250 -0
- data/src/doc/Log4r/SyslogOutputter.html +533 -0
- data/src/doc/Log4r/YamlConfigurator.html +948 -0
- data/src/doc/Log4r/base_rb.html +57 -0
- data/src/doc/Log4r/config_rb.html +76 -0
- data/src/doc/Log4r/configurator_rb.html +370 -0
- data/src/doc/Log4r/formatter/formatter_rb.html +121 -0
- data/src/doc/Log4r/formatter/patternformatter_rb.html +233 -0
- data/src/doc/Log4r/lib/drbloader_rb.html +57 -0
- data/src/doc/Log4r/lib/xmlloader_rb.html +57 -0
- data/src/doc/Log4r/logevent_rb.html +55 -0
- data/src/doc/Log4r/logger_rb.html +293 -0
- data/src/doc/Log4r/loggerfactory_rb.html +66 -0
- data/src/doc/Log4r/logserver_rb.html +161 -0
- data/src/doc/Log4r/rdoc/configurator.html +444 -0
- data/src/doc/Log4r/rdoc/emailoutputter.html +261 -0
- data/src/doc/Log4r/rdoc/formatter.html +200 -0
- data/src/doc/Log4r/rdoc/log4r.html +268 -0
- data/src/doc/Log4r/rdoc/logger.html +364 -0
- data/src/doc/Log4r/rdoc/logserver.html +247 -0
- data/src/doc/Log4r/rdoc/outputter.html +295 -0
- data/src/doc/Log4r/rdoc/patternformatter.html +313 -0
- data/src/doc/Log4r/rdoc/syslogoutputter.html +179 -0
- data/src/doc/Log4r/rdoc/yamlconfigurator.html +169 -0
- data/src/doc/Log4r/repository_rb.html +62 -0
- data/src/doc/Log4r/staticlogger_rb.html +55 -0
- data/src/doc/Log4r/yamlconfigurator_rb.html +95 -0
- data/src/doc/REXML.html +193 -0
- data/src/doc/created.rid +1 -0
- data/src/doc/images/brick.png +0 -0
- data/src/doc/images/brick_link.png +0 -0
- data/src/doc/images/bug.png +0 -0
- data/src/doc/images/bullet_black.png +0 -0
- data/src/doc/images/bullet_toggle_minus.png +0 -0
- data/src/doc/images/bullet_toggle_plus.png +0 -0
- data/src/doc/images/date.png +0 -0
- data/src/doc/images/find.png +0 -0
- data/src/doc/images/loadingAnimation.gif +0 -0
- data/src/doc/images/macFFBgHack.png +0 -0
- data/src/doc/images/package.png +0 -0
- data/src/doc/images/page_green.png +0 -0
- data/src/doc/images/page_white_text.png +0 -0
- data/src/doc/images/page_white_width.png +0 -0
- data/src/doc/images/plugin.png +0 -0
- data/src/doc/images/ruby.png +0 -0
- data/src/doc/images/tag_green.png +0 -0
- data/src/doc/images/wrench.png +0 -0
- data/src/doc/images/wrench_orange.png +0 -0
- data/src/doc/images/zoom.png +0 -0
- data/src/doc/index.html +384 -0
- data/src/doc/js/darkfish.js +116 -0
- data/src/doc/js/jquery.js +32 -0
- data/src/doc/js/quicksearch.js +114 -0
- data/src/doc/js/thickbox-compressed.js +10 -0
- data/src/doc/rdoc.css +696 -0
- data/src/log4r.rb +2 -2
- data/src/log4r/formatter/patternformatter.rb +18 -2
- data/src/log4r/logger.rb +2 -2
- data/src/log4r/outputter/emailoutputter.rb +2 -0
- data/src/log4r/outputter/syslogoutputter.rb +29 -9
- data/src/log4r/outputter/tst.rb +8 -0
- metadata +99 -3
- data/examples/logs/simple.log +0 -1
@@ -0,0 +1,910 @@
|
|
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::Outputter</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/outputter/outputter_rb.html?TB_iframe=true&height=550&width=785"
|
32
|
+
class="thickbox" title="log4r/outputter/outputter.rb">log4r/outputter/outputter.rb</a></li>
|
33
|
+
|
34
|
+
<li><a href="../log4r/outputter/staticoutputter_rb.html?TB_iframe=true&height=550&width=785"
|
35
|
+
class="thickbox" title="log4r/outputter/staticoutputter.rb">log4r/outputter/staticoutputter.rb</a></li>
|
36
|
+
|
37
|
+
</ul>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<div id="class-metadata">
|
45
|
+
|
46
|
+
<!-- Parent Class -->
|
47
|
+
|
48
|
+
<div id="parent-class-section" class="section">
|
49
|
+
<h3 class="section-header">Parent</h3>
|
50
|
+
|
51
|
+
<p class="link">Object</p>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
55
|
+
|
56
|
+
<!-- Namespace Contents -->
|
57
|
+
|
58
|
+
|
59
|
+
<!-- Method Quickref -->
|
60
|
+
|
61
|
+
<div id="method-list-section" class="section">
|
62
|
+
<h3 class="section-header">Methods</h3>
|
63
|
+
<ul class="link-list">
|
64
|
+
|
65
|
+
<li><a href="#M000093">::[]</a></li>
|
66
|
+
|
67
|
+
<li><a href="#M000096">::[]=</a></li>
|
68
|
+
|
69
|
+
<li><a href="#M000098">::each</a></li>
|
70
|
+
|
71
|
+
<li><a href="#M000099">::each_outputter</a></li>
|
72
|
+
|
73
|
+
<li><a href="#M000078">::new</a></li>
|
74
|
+
|
75
|
+
<li><a href="#M000095">::stderr</a></li>
|
76
|
+
|
77
|
+
<li><a href="#M000094">::stdout</a></li>
|
78
|
+
|
79
|
+
<li><a href="#M000084">#canonical_log</a></li>
|
80
|
+
|
81
|
+
<li><a href="#M000082">#flush</a></li>
|
82
|
+
|
83
|
+
<li><a href="#M000085">#format</a></li>
|
84
|
+
|
85
|
+
<li><a href="#M000081">#formatter=</a></li>
|
86
|
+
|
87
|
+
<li><a href="#M000079">#level=</a></li>
|
88
|
+
|
89
|
+
<li><a href="#M000080">#only_at</a></li>
|
90
|
+
|
91
|
+
<li><a href="#M000087">#synch</a></li>
|
92
|
+
|
93
|
+
<li><a href="#M000083">#validate_hash</a></li>
|
94
|
+
|
95
|
+
<li><a href="#M000086">#write</a></li>
|
96
|
+
|
97
|
+
</ul>
|
98
|
+
</div>
|
99
|
+
|
100
|
+
|
101
|
+
<!-- Included Modules -->
|
102
|
+
|
103
|
+
</div>
|
104
|
+
|
105
|
+
<div id="project-metadata">
|
106
|
+
|
107
|
+
|
108
|
+
<div id="fileindex-section" class="section project-section">
|
109
|
+
<h3 class="section-header">Files</h3>
|
110
|
+
<ul>
|
111
|
+
|
112
|
+
<li class="file"><a href="../log4r/rdoc/configurator.html">configurator</a></li>
|
113
|
+
|
114
|
+
<li class="file"><a href="../log4r/rdoc/emailoutputter.html">emailoutputter</a></li>
|
115
|
+
|
116
|
+
<li class="file"><a href="../log4r/rdoc/formatter.html">formatter</a></li>
|
117
|
+
|
118
|
+
<li class="file"><a href="../log4r/rdoc/log4r.html">log4r</a></li>
|
119
|
+
|
120
|
+
<li class="file"><a href="../log4r/rdoc/logger.html">logger</a></li>
|
121
|
+
|
122
|
+
<li class="file"><a href="../log4r/rdoc/logserver.html">logserver</a></li>
|
123
|
+
|
124
|
+
<li class="file"><a href="../log4r/rdoc/outputter.html">outputter</a></li>
|
125
|
+
|
126
|
+
<li class="file"><a href="../log4r/rdoc/patternformatter.html">patternformatter</a></li>
|
127
|
+
|
128
|
+
<li class="file"><a href="../log4r/rdoc/syslogoutputter.html">syslogoutputter</a></li>
|
129
|
+
|
130
|
+
<li class="file"><a href="../log4r/rdoc/yamlconfigurator.html">yamlconfigurator</a></li>
|
131
|
+
|
132
|
+
</ul>
|
133
|
+
</div>
|
134
|
+
|
135
|
+
|
136
|
+
<div id="classindex-section" class="section project-section">
|
137
|
+
<h3 class="section-header">Class Index
|
138
|
+
<span class="search-toggle"><img src="../images/find.png"
|
139
|
+
height="16" width="16" alt="[+]"
|
140
|
+
title="show/hide quicksearch" /></span></h3>
|
141
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
142
|
+
<fieldset>
|
143
|
+
<legend>Quicksearch</legend>
|
144
|
+
<input type="text" name="quicksearch" value=""
|
145
|
+
class="quicksearch-field" />
|
146
|
+
</fieldset>
|
147
|
+
</form>
|
148
|
+
|
149
|
+
<ul class="link-list">
|
150
|
+
|
151
|
+
<li><a href="../Log4r.html">Log4r</a></li>
|
152
|
+
|
153
|
+
<li><a href="../Log4r/BasicFormatter.html">Log4r::BasicFormatter</a></li>
|
154
|
+
|
155
|
+
<li><a href="../Log4r/ConfigError.html">Log4r::ConfigError</a></li>
|
156
|
+
|
157
|
+
<li><a href="../Log4r/Configurator.html">Log4r::Configurator</a></li>
|
158
|
+
|
159
|
+
<li><a href="../Log4r/DateFileOutputter.html">Log4r::DateFileOutputter</a></li>
|
160
|
+
|
161
|
+
<li><a href="../Log4r/DefaultFormatter.html">Log4r::DefaultFormatter</a></li>
|
162
|
+
|
163
|
+
<li><a href="../Log4r/EmailOutputter.html">Log4r::EmailOutputter</a></li>
|
164
|
+
|
165
|
+
<li><a href="../Log4r/FileOutputter.html">Log4r::FileOutputter</a></li>
|
166
|
+
|
167
|
+
<li><a href="../Log4r/Formatter.html">Log4r::Formatter</a></li>
|
168
|
+
|
169
|
+
<li><a href="../Log4r/IOOutputter.html">Log4r::IOOutputter</a></li>
|
170
|
+
|
171
|
+
<li><a href="../Log4r/Log4rTools.html">Log4r::Log4rTools</a></li>
|
172
|
+
|
173
|
+
<li><a href="../Log4r/LogEvent.html">Log4r::LogEvent</a></li>
|
174
|
+
|
175
|
+
<li><a href="../Log4r/LogServer.html">Log4r::LogServer</a></li>
|
176
|
+
|
177
|
+
<li><a href="../Log4r/Logger.html">Log4r::Logger</a></li>
|
178
|
+
|
179
|
+
<li><a href="../Log4r/ObjectFormatter.html">Log4r::ObjectFormatter</a></li>
|
180
|
+
|
181
|
+
<li><a href="../Log4r/Outputter.html">Log4r::Outputter</a></li>
|
182
|
+
|
183
|
+
<li><a href="../Log4r/PatternFormatter.html">Log4r::PatternFormatter</a></li>
|
184
|
+
|
185
|
+
<li><a href="../Log4r/RemoteOutputter.html">Log4r::RemoteOutputter</a></li>
|
186
|
+
|
187
|
+
<li><a href="../Log4r/RollingFileOutputter.html">Log4r::RollingFileOutputter</a></li>
|
188
|
+
|
189
|
+
<li><a href="../Log4r/RootLogger.html">Log4r::RootLogger</a></li>
|
190
|
+
|
191
|
+
<li><a href="../Log4r/SimpleFormatter.html">Log4r::SimpleFormatter</a></li>
|
192
|
+
|
193
|
+
<li><a href="../Log4r/StderrOutputter.html">Log4r::StderrOutputter</a></li>
|
194
|
+
|
195
|
+
<li><a href="../Log4r/StdoutOutputter.html">Log4r::StdoutOutputter</a></li>
|
196
|
+
|
197
|
+
<li><a href="../Log4r/SyslogOutputter.html">Log4r::SyslogOutputter</a></li>
|
198
|
+
|
199
|
+
<li><a href="../Log4r/YamlConfigurator.html">Log4r::YamlConfigurator</a></li>
|
200
|
+
|
201
|
+
</ul>
|
202
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
203
|
+
</div>
|
204
|
+
|
205
|
+
|
206
|
+
</div>
|
207
|
+
</div>
|
208
|
+
|
209
|
+
<div id="documentation">
|
210
|
+
<h1 class="class">Log4r::Outputter</h1>
|
211
|
+
|
212
|
+
<div id="description">
|
213
|
+
|
214
|
+
</div>
|
215
|
+
|
216
|
+
<!-- Constants -->
|
217
|
+
|
218
|
+
|
219
|
+
<!-- Attributes -->
|
220
|
+
|
221
|
+
<div id="attribute-method-details" class="method-section section">
|
222
|
+
<h3 class="section-header">Attributes</h3>
|
223
|
+
|
224
|
+
|
225
|
+
<div id="name-attribute-method" class="method-detail">
|
226
|
+
<a name="name"></a>
|
227
|
+
|
228
|
+
<div class="method-heading attribute-method-heading">
|
229
|
+
<span class="method-name">name</span><span
|
230
|
+
class="attribute-access-type">[R]</span>
|
231
|
+
</div>
|
232
|
+
|
233
|
+
<div class="method-description">
|
234
|
+
|
235
|
+
<p class="missing-docs">(Not documented)</p>
|
236
|
+
|
237
|
+
</div>
|
238
|
+
</div>
|
239
|
+
|
240
|
+
<div id="level-attribute-method" class="method-detail">
|
241
|
+
<a name="level"></a>
|
242
|
+
|
243
|
+
<div class="method-heading attribute-method-heading">
|
244
|
+
<span class="method-name">level</span><span
|
245
|
+
class="attribute-access-type">[R]</span>
|
246
|
+
</div>
|
247
|
+
|
248
|
+
<div class="method-description">
|
249
|
+
|
250
|
+
<p class="missing-docs">(Not documented)</p>
|
251
|
+
|
252
|
+
</div>
|
253
|
+
</div>
|
254
|
+
|
255
|
+
<div id="formatter-attribute-method" class="method-detail">
|
256
|
+
<a name="formatter"></a>
|
257
|
+
|
258
|
+
<div class="method-heading attribute-method-heading">
|
259
|
+
<span class="method-name">formatter</span><span
|
260
|
+
class="attribute-access-type">[R]</span>
|
261
|
+
</div>
|
262
|
+
|
263
|
+
<div class="method-description">
|
264
|
+
|
265
|
+
<p class="missing-docs">(Not documented)</p>
|
266
|
+
|
267
|
+
</div>
|
268
|
+
</div>
|
269
|
+
|
270
|
+
</div>
|
271
|
+
|
272
|
+
|
273
|
+
<!-- Methods -->
|
274
|
+
|
275
|
+
<div id="public-class-method-details" class="method-section section">
|
276
|
+
<h3 class="section-header">Public Class Methods</h3>
|
277
|
+
|
278
|
+
|
279
|
+
<div id="--method" class="method-detail ">
|
280
|
+
<a name="M000093"></a>
|
281
|
+
|
282
|
+
<div class="method-heading">
|
283
|
+
|
284
|
+
<span class="method-name">[]</span><span
|
285
|
+
class="method-args">(name)</span>
|
286
|
+
<span class="method-click-advice">click to toggle source</span>
|
287
|
+
|
288
|
+
</div>
|
289
|
+
|
290
|
+
<div class="method-description">
|
291
|
+
|
292
|
+
<p>
|
293
|
+
Retrieve an outputter.
|
294
|
+
</p>
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
<div class="method-source-code"
|
299
|
+
id="--source">
|
300
|
+
<pre>
|
301
|
+
<span class="ruby-comment cmt"># File log4r/outputter/staticoutputter.rb, line 6</span>
|
302
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-operator">[]</span>(<span class="ruby-identifier">name</span>)
|
303
|
+
<span class="ruby-identifier">out</span> = <span class="ruby-ivar">@@outputters</span>[<span class="ruby-identifier">name</span>]
|
304
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">out</span>.<span class="ruby-identifier">nil?</span>
|
305
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">name</span>
|
306
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-value str">'stdout'</span> <span class="ruby-keyword kw">then</span> <span class="ruby-constant">StdoutOutputter</span>.<span class="ruby-identifier">new</span> <span class="ruby-value str">'stdout'</span>
|
307
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-value str">'stderr'</span> <span class="ruby-keyword kw">then</span> <span class="ruby-constant">StderrOutputter</span>.<span class="ruby-identifier">new</span> <span class="ruby-value str">'stderr'</span>
|
308
|
+
<span class="ruby-keyword kw">else</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">end</span>
|
309
|
+
<span class="ruby-keyword kw">end</span>
|
310
|
+
<span class="ruby-identifier">out</span>
|
311
|
+
<span class="ruby-keyword kw">end</span></pre>
|
312
|
+
</div>
|
313
|
+
|
314
|
+
</div>
|
315
|
+
|
316
|
+
|
317
|
+
</div>
|
318
|
+
|
319
|
+
|
320
|
+
<div id="--method" class="method-detail ">
|
321
|
+
<a name="M000096"></a>
|
322
|
+
|
323
|
+
<div class="method-heading">
|
324
|
+
|
325
|
+
<span class="method-name">[]=</span><span
|
326
|
+
class="method-args">(name, outputter)</span>
|
327
|
+
<span class="method-click-advice">click to toggle source</span>
|
328
|
+
|
329
|
+
</div>
|
330
|
+
|
331
|
+
<div class="method-description">
|
332
|
+
|
333
|
+
<p>
|
334
|
+
Set an outputter.
|
335
|
+
</p>
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
<div class="method-source-code"
|
340
|
+
id="--source">
|
341
|
+
<pre>
|
342
|
+
<span class="ruby-comment cmt"># File log4r/outputter/staticoutputter.rb, line 19</span>
|
343
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-operator">[]=</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">outputter</span>)
|
344
|
+
<span class="ruby-ivar">@@outputters</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">outputter</span>
|
345
|
+
<span class="ruby-keyword kw">end</span></pre>
|
346
|
+
</div>
|
347
|
+
|
348
|
+
</div>
|
349
|
+
|
350
|
+
|
351
|
+
</div>
|
352
|
+
|
353
|
+
|
354
|
+
<div id="each-method" class="method-detail ">
|
355
|
+
<a name="M000098"></a>
|
356
|
+
|
357
|
+
<div class="method-heading">
|
358
|
+
|
359
|
+
<span class="method-name">each</span><span
|
360
|
+
class="method-args">()</span>
|
361
|
+
<span class="method-click-advice">click to toggle source</span>
|
362
|
+
|
363
|
+
</div>
|
364
|
+
|
365
|
+
<div class="method-description">
|
366
|
+
|
367
|
+
<p>
|
368
|
+
Yields each outputter’s name and reference.
|
369
|
+
</p>
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
<div class="method-source-code"
|
374
|
+
id="each-source">
|
375
|
+
<pre>
|
376
|
+
<span class="ruby-comment cmt"># File log4r/outputter/staticoutputter.rb, line 23</span>
|
377
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">each</span>
|
378
|
+
<span class="ruby-ivar">@@outputters</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">outputter</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">outputter</span>}
|
379
|
+
<span class="ruby-keyword kw">end</span></pre>
|
380
|
+
</div>
|
381
|
+
|
382
|
+
</div>
|
383
|
+
|
384
|
+
|
385
|
+
</div>
|
386
|
+
|
387
|
+
|
388
|
+
<div id="each-outputter-method" class="method-detail ">
|
389
|
+
<a name="M000099"></a>
|
390
|
+
|
391
|
+
<div class="method-heading">
|
392
|
+
|
393
|
+
<span class="method-name">each_outputter</span><span
|
394
|
+
class="method-args">()</span>
|
395
|
+
<span class="method-click-advice">click to toggle source</span>
|
396
|
+
|
397
|
+
</div>
|
398
|
+
|
399
|
+
<div class="method-description">
|
400
|
+
|
401
|
+
<p class="missing-docs">(Not documented)</p>
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
<div class="method-source-code"
|
406
|
+
id="each-outputter-source">
|
407
|
+
<pre>
|
408
|
+
<span class="ruby-comment cmt"># File log4r/outputter/staticoutputter.rb, line 26</span>
|
409
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">each_outputter</span>
|
410
|
+
<span class="ruby-ivar">@@outputters</span>.<span class="ruby-identifier">each_value</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">outputter</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">outputter</span>}
|
411
|
+
<span class="ruby-keyword kw">end</span></pre>
|
412
|
+
</div>
|
413
|
+
|
414
|
+
</div>
|
415
|
+
|
416
|
+
|
417
|
+
</div>
|
418
|
+
|
419
|
+
|
420
|
+
<div id="new-method" class="method-detail ">
|
421
|
+
<a name="M000078"></a>
|
422
|
+
|
423
|
+
<div class="method-heading">
|
424
|
+
|
425
|
+
<span class="method-name">new</span><span
|
426
|
+
class="method-args">(_name, hash={})</span>
|
427
|
+
<span class="method-click-advice">click to toggle source</span>
|
428
|
+
|
429
|
+
</div>
|
430
|
+
|
431
|
+
<div class="method-description">
|
432
|
+
|
433
|
+
<p>
|
434
|
+
An <a href="Outputter.html">Outputter</a> needs a name. <a
|
435
|
+
href="RootLogger.html">RootLogger</a> will be loaded if not already done.
|
436
|
+
The hash arguments are as follows:
|
437
|
+
</p>
|
438
|
+
<dl>
|
439
|
+
<dt><tt>:level</tt></dt><dd><a href="Logger.html">Logger</a> level. Optional, defaults to root level
|
440
|
+
|
441
|
+
</dd>
|
442
|
+
<dt><tt>:formatter</tt></dt><dd>A <a href="Formatter.html">Formatter</a>. Defaults to <a
|
443
|
+
href="DefaultFormatter.html">DefaultFormatter</a>
|
444
|
+
|
445
|
+
</dd>
|
446
|
+
</dl>
|
447
|
+
|
448
|
+
|
449
|
+
|
450
|
+
<div class="method-source-code"
|
451
|
+
id="new-source">
|
452
|
+
<pre>
|
453
|
+
<span class="ruby-comment cmt"># File log4r/outputter/outputter.rb, line 26</span>
|
454
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">_name</span>, <span class="ruby-identifier">hash</span>={})
|
455
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">_name</span>.<span class="ruby-identifier">nil?</span>
|
456
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"Bad arguments. Name and IO expected."</span>, <span class="ruby-identifier">caller</span>
|
457
|
+
<span class="ruby-keyword kw">end</span>
|
458
|
+
<span class="ruby-ivar">@name</span> = <span class="ruby-identifier">_name</span>
|
459
|
+
<span class="ruby-identifier">validate_hash</span>(<span class="ruby-identifier">hash</span>)
|
460
|
+
<span class="ruby-ivar">@@outputters</span>[<span class="ruby-ivar">@name</span>] = <span class="ruby-keyword kw">self</span>
|
461
|
+
<span class="ruby-keyword kw">end</span></pre>
|
462
|
+
</div>
|
463
|
+
|
464
|
+
</div>
|
465
|
+
|
466
|
+
|
467
|
+
</div>
|
468
|
+
|
469
|
+
|
470
|
+
<div id="stderr-method" class="method-detail ">
|
471
|
+
<a name="M000095"></a>
|
472
|
+
|
473
|
+
<div class="method-heading">
|
474
|
+
|
475
|
+
<span class="method-name">stderr</span><span
|
476
|
+
class="method-args">()</span>
|
477
|
+
<span class="method-click-advice">click to toggle source</span>
|
478
|
+
|
479
|
+
</div>
|
480
|
+
|
481
|
+
<div class="method-description">
|
482
|
+
|
483
|
+
<p class="missing-docs">(Not documented)</p>
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
<div class="method-source-code"
|
488
|
+
id="stderr-source">
|
489
|
+
<pre>
|
490
|
+
<span class="ruby-comment cmt"># File log4r/outputter/staticoutputter.rb, line 17</span>
|
491
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">stderr</span>; <span class="ruby-constant">Outputter</span>[<span class="ruby-value str">'stderr'</span>] <span class="ruby-keyword kw">end</span></pre>
|
492
|
+
</div>
|
493
|
+
|
494
|
+
</div>
|
495
|
+
|
496
|
+
|
497
|
+
</div>
|
498
|
+
|
499
|
+
|
500
|
+
<div id="stdout-method" class="method-detail ">
|
501
|
+
<a name="M000094"></a>
|
502
|
+
|
503
|
+
<div class="method-heading">
|
504
|
+
|
505
|
+
<span class="method-name">stdout</span><span
|
506
|
+
class="method-args">()</span>
|
507
|
+
<span class="method-click-advice">click to toggle source</span>
|
508
|
+
|
509
|
+
</div>
|
510
|
+
|
511
|
+
<div class="method-description">
|
512
|
+
|
513
|
+
<p class="missing-docs">(Not documented)</p>
|
514
|
+
|
515
|
+
|
516
|
+
|
517
|
+
<div class="method-source-code"
|
518
|
+
id="stdout-source">
|
519
|
+
<pre>
|
520
|
+
<span class="ruby-comment cmt"># File log4r/outputter/staticoutputter.rb, line 16</span>
|
521
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">stdout</span>; <span class="ruby-constant">Outputter</span>[<span class="ruby-value str">'stdout'</span>] <span class="ruby-keyword kw">end</span></pre>
|
522
|
+
</div>
|
523
|
+
|
524
|
+
</div>
|
525
|
+
|
526
|
+
|
527
|
+
</div>
|
528
|
+
|
529
|
+
|
530
|
+
</div>
|
531
|
+
|
532
|
+
<div id="public-instance-method-details" class="method-section section">
|
533
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
534
|
+
|
535
|
+
|
536
|
+
<div id="flush-method" class="method-detail ">
|
537
|
+
<a name="M000082"></a>
|
538
|
+
|
539
|
+
<div class="method-heading">
|
540
|
+
|
541
|
+
<span class="method-name">flush</span><span
|
542
|
+
class="method-args">()</span>
|
543
|
+
<span class="method-click-advice">click to toggle source</span>
|
544
|
+
|
545
|
+
</div>
|
546
|
+
|
547
|
+
<div class="method-description">
|
548
|
+
|
549
|
+
<p>
|
550
|
+
Call flush to force an outputter to write out any buffered log events.
|
551
|
+
Similar to IO#flush, so use in a similar fashion.
|
552
|
+
</p>
|
553
|
+
|
554
|
+
|
555
|
+
|
556
|
+
<div class="method-source-code"
|
557
|
+
id="flush-source">
|
558
|
+
<pre>
|
559
|
+
<span class="ruby-comment cmt"># File log4r/outputter/outputter.rb, line 78</span>
|
560
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">flush</span>
|
561
|
+
<span class="ruby-keyword kw">end</span></pre>
|
562
|
+
</div>
|
563
|
+
|
564
|
+
</div>
|
565
|
+
|
566
|
+
|
567
|
+
</div>
|
568
|
+
|
569
|
+
|
570
|
+
<div id="formatter--method" class="method-detail ">
|
571
|
+
<a name="M000081"></a>
|
572
|
+
|
573
|
+
<div class="method-heading">
|
574
|
+
|
575
|
+
<span class="method-name">formatter=</span><span
|
576
|
+
class="method-args">(_formatter)</span>
|
577
|
+
<span class="method-click-advice">click to toggle source</span>
|
578
|
+
|
579
|
+
</div>
|
580
|
+
|
581
|
+
<div class="method-description">
|
582
|
+
|
583
|
+
<p>
|
584
|
+
Dynamically change the formatter. You can just specify a Class object and
|
585
|
+
the formatter will invoke <tt>new</tt> or <tt>instance</tt> on it as
|
586
|
+
appropriate.
|
587
|
+
</p>
|
588
|
+
|
589
|
+
|
590
|
+
|
591
|
+
<div class="method-source-code"
|
592
|
+
id="formatter--source">
|
593
|
+
<pre>
|
594
|
+
<span class="ruby-comment cmt"># File log4r/outputter/outputter.rb, line 60</span>
|
595
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">formatter=</span>(<span class="ruby-identifier">_formatter</span>)
|
596
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">_formatter</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Formatter</span>)
|
597
|
+
<span class="ruby-ivar">@formatter</span> = <span class="ruby-identifier">_formatter</span>
|
598
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">_formatter</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Class</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">_formatter</span> <span class="ruby-operator"><=</span> <span class="ruby-constant">Formatter</span>
|
599
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">_formatter</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">:instance</span>
|
600
|
+
<span class="ruby-ivar">@formatter</span> = <span class="ruby-identifier">_formatter</span>.<span class="ruby-identifier">instance</span>
|
601
|
+
<span class="ruby-keyword kw">else</span>
|
602
|
+
<span class="ruby-ivar">@formatter</span> = <span class="ruby-identifier">_formatter</span>.<span class="ruby-identifier">new</span>
|
603
|
+
<span class="ruby-keyword kw">end</span>
|
604
|
+
<span class="ruby-keyword kw">else</span>
|
605
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-value str">"Argument was not a Formatter!"</span>, <span class="ruby-identifier">caller</span>
|
606
|
+
<span class="ruby-keyword kw">end</span>
|
607
|
+
<span class="ruby-constant">Logger</span>.<span class="ruby-identifier">log_internal</span> {<span class="ruby-node">"Outputter '#{@name}' using #{@formatter.class}"</span>}
|
608
|
+
<span class="ruby-keyword kw">end</span></pre>
|
609
|
+
</div>
|
610
|
+
|
611
|
+
</div>
|
612
|
+
|
613
|
+
|
614
|
+
</div>
|
615
|
+
|
616
|
+
|
617
|
+
<div id="level--method" class="method-detail ">
|
618
|
+
<a name="M000079"></a>
|
619
|
+
|
620
|
+
<div class="method-heading">
|
621
|
+
|
622
|
+
<span class="method-name">level=</span><span
|
623
|
+
class="method-args">(_level)</span>
|
624
|
+
<span class="method-click-advice">click to toggle source</span>
|
625
|
+
|
626
|
+
</div>
|
627
|
+
|
628
|
+
<div class="method-description">
|
629
|
+
|
630
|
+
<p>
|
631
|
+
dynamically change the level
|
632
|
+
</p>
|
633
|
+
|
634
|
+
|
635
|
+
|
636
|
+
<div class="method-source-code"
|
637
|
+
id="level--source">
|
638
|
+
<pre>
|
639
|
+
<span class="ruby-comment cmt"># File log4r/outputter/outputter.rb, line 36</span>
|
640
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">level=</span>(<span class="ruby-identifier">_level</span>)
|
641
|
+
<span class="ruby-constant">Log4rTools</span>.<span class="ruby-identifier">validate_level</span>(<span class="ruby-identifier">_level</span>)
|
642
|
+
<span class="ruby-ivar">@level</span> = <span class="ruby-identifier">_level</span>
|
643
|
+
<span class="ruby-constant">OutputterFactory</span>.<span class="ruby-identifier">create_methods</span>(<span class="ruby-keyword kw">self</span>)
|
644
|
+
<span class="ruby-constant">Logger</span>.<span class="ruby-identifier">log_internal</span> {<span class="ruby-node">"Outputter '#{@name}' level is #{LNAMES[_level]}"</span>}
|
645
|
+
<span class="ruby-keyword kw">end</span></pre>
|
646
|
+
</div>
|
647
|
+
|
648
|
+
</div>
|
649
|
+
|
650
|
+
|
651
|
+
</div>
|
652
|
+
|
653
|
+
|
654
|
+
<div id="only-at-method" class="method-detail ">
|
655
|
+
<a name="M000080"></a>
|
656
|
+
|
657
|
+
<div class="method-heading">
|
658
|
+
|
659
|
+
<span class="method-name">only_at</span><span
|
660
|
+
class="method-args">(*levels)</span>
|
661
|
+
<span class="method-click-advice">click to toggle source</span>
|
662
|
+
|
663
|
+
</div>
|
664
|
+
|
665
|
+
<div class="method-description">
|
666
|
+
|
667
|
+
<p>
|
668
|
+
Set the levels to log. All others will be ignored
|
669
|
+
</p>
|
670
|
+
|
671
|
+
|
672
|
+
|
673
|
+
<div class="method-source-code"
|
674
|
+
id="only-at-source">
|
675
|
+
<pre>
|
676
|
+
<span class="ruby-comment cmt"># File log4r/outputter/outputter.rb, line 44</span>
|
677
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">only_at</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">levels</span>)
|
678
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"Gimme some levels!"</span>, <span class="ruby-identifier">caller</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">levels</span>.<span class="ruby-identifier">empty?</span>
|
679
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"Can't log only_at ALL"</span>, <span class="ruby-identifier">caller</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">levels</span>.<span class="ruby-identifier">include?</span> <span class="ruby-constant">ALL</span>
|
680
|
+
<span class="ruby-identifier">levels</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">level</span><span class="ruby-operator">|</span> <span class="ruby-constant">Log4rTools</span>.<span class="ruby-identifier">validate_level</span>(<span class="ruby-identifier">level</span>)}
|
681
|
+
<span class="ruby-ivar">@level</span> = <span class="ruby-identifier">levels</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">first</span>
|
682
|
+
<span class="ruby-constant">OutputterFactory</span>.<span class="ruby-identifier">create_methods</span> <span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">levels</span>
|
683
|
+
<span class="ruby-constant">Logger</span>.<span class="ruby-identifier">log_internal</span> {
|
684
|
+
<span class="ruby-node">"Outputter '#{@name}' writes only on "</span> <span class="ruby-operator">+</span>\
|
685
|
+
<span class="ruby-identifier">levels</span>.<span class="ruby-identifier">collect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span> <span class="ruby-constant">LNAMES</span>[<span class="ruby-identifier">l</span>]}.<span class="ruby-identifier">join</span>(<span class="ruby-value str">", "</span>)
|
686
|
+
}
|
687
|
+
<span class="ruby-keyword kw">end</span></pre>
|
688
|
+
</div>
|
689
|
+
|
690
|
+
</div>
|
691
|
+
|
692
|
+
|
693
|
+
</div>
|
694
|
+
|
695
|
+
|
696
|
+
</div>
|
697
|
+
|
698
|
+
<div id="protected-instance-method-details" class="method-section section">
|
699
|
+
<h3 class="section-header">Protected Instance Methods</h3>
|
700
|
+
|
701
|
+
|
702
|
+
<div id="validate-hash-method" class="method-detail ">
|
703
|
+
<a name="M000083"></a>
|
704
|
+
|
705
|
+
<div class="method-heading">
|
706
|
+
|
707
|
+
<span class="method-name">validate_hash</span><span
|
708
|
+
class="method-args">(hash)</span>
|
709
|
+
<span class="method-click-advice">click to toggle source</span>
|
710
|
+
|
711
|
+
</div>
|
712
|
+
|
713
|
+
<div class="method-description">
|
714
|
+
|
715
|
+
<p>
|
716
|
+
Validates the common hash arguments. For now, that would be
|
717
|
+
<tt>:level</tt>, <tt>:formatter</tt> and the string equivalents
|
718
|
+
</p>
|
719
|
+
|
720
|
+
|
721
|
+
|
722
|
+
<div class="method-source-code"
|
723
|
+
id="validate-hash-source">
|
724
|
+
<pre>
|
725
|
+
<span class="ruby-comment cmt"># File log4r/outputter/outputter.rb, line 87</span>
|
726
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_hash</span>(<span class="ruby-identifier">hash</span>)
|
727
|
+
<span class="ruby-ivar">@mutex</span> = <span class="ruby-constant">Mutex</span>.<span class="ruby-identifier">new</span>
|
728
|
+
<span class="ruby-comment cmt"># default to root level and DefaultFormatter</span>
|
729
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">empty?</span>
|
730
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">level</span> = <span class="ruby-constant">Logger</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">level</span>
|
731
|
+
<span class="ruby-ivar">@formatter</span> = <span class="ruby-constant">DefaultFormatter</span>.<span class="ruby-identifier">new</span>
|
732
|
+
<span class="ruby-keyword kw">return</span>
|
733
|
+
<span class="ruby-keyword kw">end</span>
|
734
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">level</span> = (<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:level</span>] <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'level'</span>] <span class="ruby-keyword kw">or</span> <span class="ruby-constant">Logger</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">level</span>)
|
735
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">formatter</span> = (<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:formatter</span>] <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'formatter'</span>] <span class="ruby-keyword kw">or</span> <span class="ruby-constant">DefaultFormatter</span>.<span class="ruby-identifier">new</span>)
|
736
|
+
<span class="ruby-keyword kw">end</span></pre>
|
737
|
+
</div>
|
738
|
+
|
739
|
+
</div>
|
740
|
+
|
741
|
+
|
742
|
+
</div>
|
743
|
+
|
744
|
+
|
745
|
+
</div>
|
746
|
+
|
747
|
+
<div id="private-instance-method-details" class="method-section section">
|
748
|
+
<h3 class="section-header">Private Instance Methods</h3>
|
749
|
+
|
750
|
+
|
751
|
+
<div id="canonical-log-method" class="method-detail ">
|
752
|
+
<a name="M000084"></a>
|
753
|
+
|
754
|
+
<div class="method-heading">
|
755
|
+
|
756
|
+
<span class="method-name">canonical_log</span><span
|
757
|
+
class="method-args">(logevent)</span>
|
758
|
+
<span class="method-click-advice">click to toggle source</span>
|
759
|
+
|
760
|
+
</div>
|
761
|
+
|
762
|
+
<div class="method-description">
|
763
|
+
|
764
|
+
<p>
|
765
|
+
This method handles all log events passed to a typical <a
|
766
|
+
href="Outputter.html">Outputter</a>. Overload this to change the overall
|
767
|
+
behavior of an outputter. Make sure that the new behavior is thread safe.
|
768
|
+
</p>
|
769
|
+
|
770
|
+
|
771
|
+
|
772
|
+
<div class="method-source-code"
|
773
|
+
id="canonical-log-source">
|
774
|
+
<pre>
|
775
|
+
<span class="ruby-comment cmt"># File log4r/outputter/outputter.rb, line 107</span>
|
776
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">canonical_log</span>(<span class="ruby-identifier">logevent</span>)
|
777
|
+
<span class="ruby-identifier">synch</span> { <span class="ruby-identifier">write</span>(<span class="ruby-identifier">format</span>(<span class="ruby-identifier">logevent</span>)) }
|
778
|
+
<span class="ruby-keyword kw">end</span></pre>
|
779
|
+
</div>
|
780
|
+
|
781
|
+
</div>
|
782
|
+
|
783
|
+
|
784
|
+
</div>
|
785
|
+
|
786
|
+
|
787
|
+
<div id="format-method" class="method-detail ">
|
788
|
+
<a name="M000085"></a>
|
789
|
+
|
790
|
+
<div class="method-heading">
|
791
|
+
|
792
|
+
<span class="method-name">format</span><span
|
793
|
+
class="method-args">(logevent)</span>
|
794
|
+
<span class="method-click-advice">click to toggle source</span>
|
795
|
+
|
796
|
+
</div>
|
797
|
+
|
798
|
+
<div class="method-description">
|
799
|
+
|
800
|
+
<p>
|
801
|
+
Common method to format data. All it does is call the resident
|
802
|
+
formatter’s format method. If a different formatting behavior is
|
803
|
+
needed, then overload this method.
|
804
|
+
</p>
|
805
|
+
|
806
|
+
|
807
|
+
|
808
|
+
<div class="method-source-code"
|
809
|
+
id="format-source">
|
810
|
+
<pre>
|
811
|
+
<span class="ruby-comment cmt"># File log4r/outputter/outputter.rb, line 115</span>
|
812
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">format</span>(<span class="ruby-identifier">logevent</span>)
|
813
|
+
<span class="ruby-comment cmt"># @formatter is guaranteed to be DefaultFormatter if no Formatter</span>
|
814
|
+
<span class="ruby-comment cmt"># was specified</span>
|
815
|
+
<span class="ruby-ivar">@formatter</span>.<span class="ruby-identifier">format</span>(<span class="ruby-identifier">logevent</span>)
|
816
|
+
<span class="ruby-keyword kw">end</span></pre>
|
817
|
+
</div>
|
818
|
+
|
819
|
+
</div>
|
820
|
+
|
821
|
+
|
822
|
+
</div>
|
823
|
+
|
824
|
+
|
825
|
+
<div id="synch-method" class="method-detail ">
|
826
|
+
<a name="M000087"></a>
|
827
|
+
|
828
|
+
<div class="method-heading">
|
829
|
+
|
830
|
+
<span class="method-name">synch</span><span
|
831
|
+
class="method-args">()</span>
|
832
|
+
<span class="method-click-advice">click to toggle source</span>
|
833
|
+
|
834
|
+
</div>
|
835
|
+
|
836
|
+
<div class="method-description">
|
837
|
+
|
838
|
+
<p class="missing-docs">(Not documented)</p>
|
839
|
+
|
840
|
+
|
841
|
+
|
842
|
+
<div class="method-source-code"
|
843
|
+
id="synch-source">
|
844
|
+
<pre>
|
845
|
+
<span class="ruby-comment cmt"># File log4r/outputter/outputter.rb, line 128</span>
|
846
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">synch</span>; <span class="ruby-ivar">@mutex</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-keyword kw">yield</span> } <span class="ruby-keyword kw">end</span></pre>
|
847
|
+
</div>
|
848
|
+
|
849
|
+
</div>
|
850
|
+
|
851
|
+
|
852
|
+
</div>
|
853
|
+
|
854
|
+
|
855
|
+
<div id="write-method" class="method-detail ">
|
856
|
+
<a name="M000086"></a>
|
857
|
+
|
858
|
+
<div class="method-heading">
|
859
|
+
|
860
|
+
<span class="method-name">write</span><span
|
861
|
+
class="method-args">(data)</span>
|
862
|
+
<span class="method-click-advice">click to toggle source</span>
|
863
|
+
|
864
|
+
</div>
|
865
|
+
|
866
|
+
<div class="method-description">
|
867
|
+
|
868
|
+
<p>
|
869
|
+
Abstract method to actually write the data to a destination. Custom
|
870
|
+
outputters should overload this to specify how the formatted data should be
|
871
|
+
written and to where.
|
872
|
+
</p>
|
873
|
+
|
874
|
+
|
875
|
+
|
876
|
+
<div class="method-source-code"
|
877
|
+
id="write-source">
|
878
|
+
<pre>
|
879
|
+
<span class="ruby-comment cmt"># File log4r/outputter/outputter.rb, line 125</span>
|
880
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write</span>(<span class="ruby-identifier">data</span>)
|
881
|
+
<span class="ruby-keyword kw">end</span></pre>
|
882
|
+
</div>
|
883
|
+
|
884
|
+
</div>
|
885
|
+
|
886
|
+
|
887
|
+
</div>
|
888
|
+
|
889
|
+
|
890
|
+
</div>
|
891
|
+
|
892
|
+
|
893
|
+
</div>
|
894
|
+
|
895
|
+
|
896
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
897
|
+
|
898
|
+
<p>Disabled; run with --debug to generate this.</p>
|
899
|
+
|
900
|
+
</div>
|
901
|
+
|
902
|
+
<div id="validator-badges">
|
903
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
904
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
905
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
906
|
+
</div>
|
907
|
+
|
908
|
+
</body>
|
909
|
+
</html>
|
910
|
+
|