log4r 1.1.6 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,346 @@
|
|
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::FileOutputter</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/fileoutputter_rb.html?TB_iframe=true&height=550&width=785"
|
32
|
+
class="thickbox" title="log4r/outputter/fileoutputter.rb">log4r/outputter/fileoutputter.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">IOOutputter</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="#M000093">::new</a></li>
|
63
|
+
|
64
|
+
</ul>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
|
68
|
+
<!-- Included Modules -->
|
69
|
+
|
70
|
+
</div>
|
71
|
+
|
72
|
+
<div id="project-metadata">
|
73
|
+
|
74
|
+
|
75
|
+
<div id="fileindex-section" class="section project-section">
|
76
|
+
<h3 class="section-header">Files</h3>
|
77
|
+
<ul>
|
78
|
+
|
79
|
+
<li class="file"><a href="../log4r/rdoc/GDC.html">GDC</a></li>
|
80
|
+
|
81
|
+
<li class="file"><a href="../log4r/rdoc/MDC.html">MDC</a></li>
|
82
|
+
|
83
|
+
<li class="file"><a href="../log4r/rdoc/NDC.html">NDC</a></li>
|
84
|
+
|
85
|
+
<li class="file"><a href="../log4r/rdoc/configurator.html">configurator</a></li>
|
86
|
+
|
87
|
+
<li class="file"><a href="../log4r/rdoc/emailoutputter.html">emailoutputter</a></li>
|
88
|
+
|
89
|
+
<li class="file"><a href="../log4r/rdoc/formatter.html">formatter</a></li>
|
90
|
+
|
91
|
+
<li class="file"><a href="../log4r/rdoc/log4r.html">log4r</a></li>
|
92
|
+
|
93
|
+
<li class="file"><a href="../log4r/rdoc/logger.html">logger</a></li>
|
94
|
+
|
95
|
+
<li class="file"><a href="../log4r/rdoc/logserver.html">logserver</a></li>
|
96
|
+
|
97
|
+
<li class="file"><a href="../log4r/rdoc/outputter.html">outputter</a></li>
|
98
|
+
|
99
|
+
<li class="file"><a href="../log4r/rdoc/patternformatter.html">patternformatter</a></li>
|
100
|
+
|
101
|
+
<li class="file"><a href="../log4r/rdoc/syslogoutputter.html">syslogoutputter</a></li>
|
102
|
+
|
103
|
+
<li class="file"><a href="../log4r/rdoc/win32eventoutputter.html">win32eventoutputter</a></li>
|
104
|
+
|
105
|
+
<li class="file"><a href="../log4r/rdoc/yamlconfigurator.html">yamlconfigurator</a></li>
|
106
|
+
|
107
|
+
</ul>
|
108
|
+
</div>
|
109
|
+
|
110
|
+
|
111
|
+
<div id="classindex-section" class="section project-section">
|
112
|
+
<h3 class="section-header">Class Index
|
113
|
+
<span class="search-toggle"><img src="../images/find.png"
|
114
|
+
height="16" width="16" alt="[+]"
|
115
|
+
title="show/hide quicksearch" /></span></h3>
|
116
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
117
|
+
<fieldset>
|
118
|
+
<legend>Quicksearch</legend>
|
119
|
+
<input type="text" name="quicksearch" value=""
|
120
|
+
class="quicksearch-field" />
|
121
|
+
</fieldset>
|
122
|
+
</form>
|
123
|
+
|
124
|
+
<ul class="link-list">
|
125
|
+
|
126
|
+
<li><a href="../Log4r.html">Log4r</a></li>
|
127
|
+
|
128
|
+
<li><a href="../Log4r/BasicFormatter.html">Log4r::BasicFormatter</a></li>
|
129
|
+
|
130
|
+
<li><a href="../Log4r/ConfigError.html">Log4r::ConfigError</a></li>
|
131
|
+
|
132
|
+
<li><a href="../Log4r/Configurator.html">Log4r::Configurator</a></li>
|
133
|
+
|
134
|
+
<li><a href="../Log4r/DateFileOutputter.html">Log4r::DateFileOutputter</a></li>
|
135
|
+
|
136
|
+
<li><a href="../Log4r/DefaultFormatter.html">Log4r::DefaultFormatter</a></li>
|
137
|
+
|
138
|
+
<li><a href="../Log4r/EmailOutputter.html">Log4r::EmailOutputter</a></li>
|
139
|
+
|
140
|
+
<li><a href="../Log4r/FileOutputter.html">Log4r::FileOutputter</a></li>
|
141
|
+
|
142
|
+
<li><a href="../Log4r/Formatter.html">Log4r::Formatter</a></li>
|
143
|
+
|
144
|
+
<li><a href="../Log4r/GDC.html">Log4r::GDC</a></li>
|
145
|
+
|
146
|
+
<li><a href="../Log4r/IOOutputter.html">Log4r::IOOutputter</a></li>
|
147
|
+
|
148
|
+
<li><a href="../Log4r/Log4jXmlFormatter.html">Log4r::Log4jXmlFormatter</a></li>
|
149
|
+
|
150
|
+
<li><a href="../Log4r/Log4rTools.html">Log4r::Log4rTools</a></li>
|
151
|
+
|
152
|
+
<li><a href="../Log4r/LogEvent.html">Log4r::LogEvent</a></li>
|
153
|
+
|
154
|
+
<li><a href="../Log4r/LogServer.html">Log4r::LogServer</a></li>
|
155
|
+
|
156
|
+
<li><a href="../Log4r/Logger.html">Log4r::Logger</a></li>
|
157
|
+
|
158
|
+
<li><a href="../Log4r/MDC.html">Log4r::MDC</a></li>
|
159
|
+
|
160
|
+
<li><a href="../Log4r/NDC.html">Log4r::NDC</a></li>
|
161
|
+
|
162
|
+
<li><a href="../Log4r/ObjectFormatter.html">Log4r::ObjectFormatter</a></li>
|
163
|
+
|
164
|
+
<li><a href="../Log4r/Outputter.html">Log4r::Outputter</a></li>
|
165
|
+
|
166
|
+
<li><a href="../Log4r/PatternFormatter.html">Log4r::PatternFormatter</a></li>
|
167
|
+
|
168
|
+
<li><a href="../Log4r/RemoteOutputter.html">Log4r::RemoteOutputter</a></li>
|
169
|
+
|
170
|
+
<li><a href="../Log4r/RollingFileOutputter.html">Log4r::RollingFileOutputter</a></li>
|
171
|
+
|
172
|
+
<li><a href="../Log4r/RootLogger.html">Log4r::RootLogger</a></li>
|
173
|
+
|
174
|
+
<li><a href="../Log4r/SimpleFormatter.html">Log4r::SimpleFormatter</a></li>
|
175
|
+
|
176
|
+
<li><a href="../Log4r/StderrOutputter.html">Log4r::StderrOutputter</a></li>
|
177
|
+
|
178
|
+
<li><a href="../Log4r/StdoutOutputter.html">Log4r::StdoutOutputter</a></li>
|
179
|
+
|
180
|
+
<li><a href="../Log4r/SyslogOutputter.html">Log4r::SyslogOutputter</a></li>
|
181
|
+
|
182
|
+
<li><a href="../Log4r/UDPOutputter.html">Log4r::UDPOutputter</a></li>
|
183
|
+
|
184
|
+
<li><a href="../Log4r/YamlConfigurator.html">Log4r::YamlConfigurator</a></li>
|
185
|
+
|
186
|
+
</ul>
|
187
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
188
|
+
</div>
|
189
|
+
|
190
|
+
|
191
|
+
</div>
|
192
|
+
</div>
|
193
|
+
|
194
|
+
<div id="documentation">
|
195
|
+
<h1 class="class">Log4r::FileOutputter</h1>
|
196
|
+
|
197
|
+
<div id="description">
|
198
|
+
<p>
|
199
|
+
Convenience wrapper for File. Additional hash arguments are:
|
200
|
+
</p>
|
201
|
+
<dl>
|
202
|
+
<dt><tt>:filename</tt></dt><dd>Name of the file to log to.
|
203
|
+
|
204
|
+
</dd>
|
205
|
+
<dt><tt>:trunc</tt></dt><dd>Truncate the file?
|
206
|
+
|
207
|
+
</dd>
|
208
|
+
</dl>
|
209
|
+
|
210
|
+
</div>
|
211
|
+
|
212
|
+
<!-- Constants -->
|
213
|
+
|
214
|
+
|
215
|
+
<!-- Attributes -->
|
216
|
+
|
217
|
+
<div id="attribute-method-details" class="method-section section">
|
218
|
+
<h3 class="section-header">Attributes</h3>
|
219
|
+
|
220
|
+
|
221
|
+
<div id="trunc-attribute-method" class="method-detail">
|
222
|
+
<a name="trunc"></a>
|
223
|
+
|
224
|
+
<div class="method-heading attribute-method-heading">
|
225
|
+
<span class="method-name">trunc</span><span
|
226
|
+
class="attribute-access-type">[R]</span>
|
227
|
+
</div>
|
228
|
+
|
229
|
+
<div class="method-description">
|
230
|
+
|
231
|
+
<p class="missing-docs">(Not documented)</p>
|
232
|
+
|
233
|
+
</div>
|
234
|
+
</div>
|
235
|
+
|
236
|
+
<div id="filename-attribute-method" class="method-detail">
|
237
|
+
<a name="filename"></a>
|
238
|
+
|
239
|
+
<div class="method-heading attribute-method-heading">
|
240
|
+
<span class="method-name">filename</span><span
|
241
|
+
class="attribute-access-type">[R]</span>
|
242
|
+
</div>
|
243
|
+
|
244
|
+
<div class="method-description">
|
245
|
+
|
246
|
+
<p class="missing-docs">(Not documented)</p>
|
247
|
+
|
248
|
+
</div>
|
249
|
+
</div>
|
250
|
+
|
251
|
+
</div>
|
252
|
+
|
253
|
+
|
254
|
+
<!-- Methods -->
|
255
|
+
|
256
|
+
<div id="public-class-method-details" class="method-section section">
|
257
|
+
<h3 class="section-header">Public Class Methods</h3>
|
258
|
+
|
259
|
+
|
260
|
+
<div id="new-method" class="method-detail ">
|
261
|
+
<a name="M000093"></a>
|
262
|
+
|
263
|
+
<div class="method-heading">
|
264
|
+
|
265
|
+
<span class="method-name">new</span><span
|
266
|
+
class="method-args">(_name, hash={})</span>
|
267
|
+
<span class="method-click-advice">click to toggle source</span>
|
268
|
+
|
269
|
+
</div>
|
270
|
+
|
271
|
+
<div class="method-description">
|
272
|
+
|
273
|
+
<p class="missing-docs">(Not documented)</p>
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
<div class="method-source-code"
|
278
|
+
id="new-source">
|
279
|
+
<pre>
|
280
|
+
<span class="ruby-comment cmt"># File log4r/outputter/fileoutputter.rb, line 16</span>
|
281
|
+
<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>={})
|
282
|
+
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">_name</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">hash</span>)
|
283
|
+
|
284
|
+
<span class="ruby-ivar">@trunc</span> = <span class="ruby-constant">Log4rTools</span>.<span class="ruby-identifier">decode_bool</span>(<span class="ruby-identifier">hash</span>, <span class="ruby-identifier">:trunc</span>, <span class="ruby-keyword kw">false</span>)
|
285
|
+
<span class="ruby-identifier">_filename</span> = (<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:filename</span>] <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'filename'</span>])
|
286
|
+
<span class="ruby-ivar">@create</span> = <span class="ruby-constant">Log4rTools</span>.<span class="ruby-identifier">decode_bool</span>(<span class="ruby-identifier">hash</span>, <span class="ruby-identifier">:create</span>, <span class="ruby-keyword kw">true</span>)
|
287
|
+
|
288
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">_filename</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">String</span>
|
289
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-value str">"Argument 'filename' must be a String"</span>, <span class="ruby-identifier">caller</span>
|
290
|
+
<span class="ruby-keyword kw">end</span>
|
291
|
+
|
292
|
+
<span class="ruby-comment cmt"># file validation</span>
|
293
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-constant">FileTest</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">_filename</span> )
|
294
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-constant">FileTest</span>.<span class="ruby-identifier">file?</span>( <span class="ruby-identifier">_filename</span> )
|
295
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">StandardError</span>, <span class="ruby-node">"'#{_filename}' is not a regular file"</span>, <span class="ruby-identifier">caller</span>
|
296
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-keyword kw">not</span> <span class="ruby-constant">FileTest</span>.<span class="ruby-identifier">writable?</span>( <span class="ruby-identifier">_filename</span> )
|
297
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">StandardError</span>, <span class="ruby-node">"'#{_filename}' is not writable!"</span>, <span class="ruby-identifier">caller</span>
|
298
|
+
<span class="ruby-keyword kw">end</span>
|
299
|
+
<span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># ensure directory is writable</span>
|
300
|
+
<span class="ruby-identifier">dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>( <span class="ruby-identifier">_filename</span> )
|
301
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-constant">FileTest</span>.<span class="ruby-identifier">writable?</span>( <span class="ruby-identifier">dir</span> )
|
302
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">StandardError</span>, <span class="ruby-node">"'#{dir}' is not writable!"</span>
|
303
|
+
<span class="ruby-keyword kw">end</span>
|
304
|
+
<span class="ruby-keyword kw">end</span>
|
305
|
+
|
306
|
+
<span class="ruby-ivar">@filename</span> = <span class="ruby-identifier">_filename</span>
|
307
|
+
<span class="ruby-keyword kw">if</span> ( <span class="ruby-ivar">@create</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">true</span> ) <span class="ruby-keyword kw">then</span>
|
308
|
+
<span class="ruby-ivar">@out</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@filename</span>, (<span class="ruby-ivar">@trunc</span> <span class="ruby-operator">?</span> <span class="ruby-value str">"w"</span> <span class="ruby-operator">:</span> <span class="ruby-value str">"a"</span>))
|
309
|
+
<span class="ruby-constant">Logger</span>.<span class="ruby-identifier">log_internal</span> {
|
310
|
+
<span class="ruby-node">"FileOutputter '#{@name}' writing to #{@filename}"</span>
|
311
|
+
}
|
312
|
+
<span class="ruby-keyword kw">else</span>
|
313
|
+
<span class="ruby-constant">Logger</span>.<span class="ruby-identifier">log_internal</span> {
|
314
|
+
<span class="ruby-node">"FileOutputter '#{@name}' called with :create == false, #{@filename}"</span>
|
315
|
+
}
|
316
|
+
<span class="ruby-keyword kw">end</span>
|
317
|
+
<span class="ruby-keyword kw">end</span></pre>
|
318
|
+
</div>
|
319
|
+
|
320
|
+
</div>
|
321
|
+
|
322
|
+
|
323
|
+
</div>
|
324
|
+
|
325
|
+
|
326
|
+
</div>
|
327
|
+
|
328
|
+
|
329
|
+
</div>
|
330
|
+
|
331
|
+
|
332
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
333
|
+
|
334
|
+
<p>Disabled; run with --debug to generate this.</p>
|
335
|
+
|
336
|
+
</div>
|
337
|
+
|
338
|
+
<div id="validator-badges">
|
339
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
340
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
341
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
342
|
+
</div>
|
343
|
+
|
344
|
+
</body>
|
345
|
+
</html>
|
346
|
+
|
@@ -0,0 +1,309 @@
|
|
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::Formatter</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/formatter/formatter_rb.html?TB_iframe=true&height=550&width=785"
|
32
|
+
class="thickbox" title="log4r/formatter/formatter.rb">log4r/formatter/formatter.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="#M000006">::new</a></li>
|
63
|
+
|
64
|
+
<li><a href="#M000007">#format</a></li>
|
65
|
+
|
66
|
+
</ul>
|
67
|
+
</div>
|
68
|
+
|
69
|
+
|
70
|
+
<!-- Included Modules -->
|
71
|
+
|
72
|
+
</div>
|
73
|
+
|
74
|
+
<div id="project-metadata">
|
75
|
+
|
76
|
+
|
77
|
+
<div id="fileindex-section" class="section project-section">
|
78
|
+
<h3 class="section-header">Files</h3>
|
79
|
+
<ul>
|
80
|
+
|
81
|
+
<li class="file"><a href="../log4r/rdoc/GDC.html">GDC</a></li>
|
82
|
+
|
83
|
+
<li class="file"><a href="../log4r/rdoc/MDC.html">MDC</a></li>
|
84
|
+
|
85
|
+
<li class="file"><a href="../log4r/rdoc/NDC.html">NDC</a></li>
|
86
|
+
|
87
|
+
<li class="file"><a href="../log4r/rdoc/configurator.html">configurator</a></li>
|
88
|
+
|
89
|
+
<li class="file"><a href="../log4r/rdoc/emailoutputter.html">emailoutputter</a></li>
|
90
|
+
|
91
|
+
<li class="file"><a href="../log4r/rdoc/formatter.html">formatter</a></li>
|
92
|
+
|
93
|
+
<li class="file"><a href="../log4r/rdoc/log4r.html">log4r</a></li>
|
94
|
+
|
95
|
+
<li class="file"><a href="../log4r/rdoc/logger.html">logger</a></li>
|
96
|
+
|
97
|
+
<li class="file"><a href="../log4r/rdoc/logserver.html">logserver</a></li>
|
98
|
+
|
99
|
+
<li class="file"><a href="../log4r/rdoc/outputter.html">outputter</a></li>
|
100
|
+
|
101
|
+
<li class="file"><a href="../log4r/rdoc/patternformatter.html">patternformatter</a></li>
|
102
|
+
|
103
|
+
<li class="file"><a href="../log4r/rdoc/syslogoutputter.html">syslogoutputter</a></li>
|
104
|
+
|
105
|
+
<li class="file"><a href="../log4r/rdoc/win32eventoutputter.html">win32eventoutputter</a></li>
|
106
|
+
|
107
|
+
<li class="file"><a href="../log4r/rdoc/yamlconfigurator.html">yamlconfigurator</a></li>
|
108
|
+
|
109
|
+
</ul>
|
110
|
+
</div>
|
111
|
+
|
112
|
+
|
113
|
+
<div id="classindex-section" class="section project-section">
|
114
|
+
<h3 class="section-header">Class Index
|
115
|
+
<span class="search-toggle"><img src="../images/find.png"
|
116
|
+
height="16" width="16" alt="[+]"
|
117
|
+
title="show/hide quicksearch" /></span></h3>
|
118
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
119
|
+
<fieldset>
|
120
|
+
<legend>Quicksearch</legend>
|
121
|
+
<input type="text" name="quicksearch" value=""
|
122
|
+
class="quicksearch-field" />
|
123
|
+
</fieldset>
|
124
|
+
</form>
|
125
|
+
|
126
|
+
<ul class="link-list">
|
127
|
+
|
128
|
+
<li><a href="../Log4r.html">Log4r</a></li>
|
129
|
+
|
130
|
+
<li><a href="../Log4r/BasicFormatter.html">Log4r::BasicFormatter</a></li>
|
131
|
+
|
132
|
+
<li><a href="../Log4r/ConfigError.html">Log4r::ConfigError</a></li>
|
133
|
+
|
134
|
+
<li><a href="../Log4r/Configurator.html">Log4r::Configurator</a></li>
|
135
|
+
|
136
|
+
<li><a href="../Log4r/DateFileOutputter.html">Log4r::DateFileOutputter</a></li>
|
137
|
+
|
138
|
+
<li><a href="../Log4r/DefaultFormatter.html">Log4r::DefaultFormatter</a></li>
|
139
|
+
|
140
|
+
<li><a href="../Log4r/EmailOutputter.html">Log4r::EmailOutputter</a></li>
|
141
|
+
|
142
|
+
<li><a href="../Log4r/FileOutputter.html">Log4r::FileOutputter</a></li>
|
143
|
+
|
144
|
+
<li><a href="../Log4r/Formatter.html">Log4r::Formatter</a></li>
|
145
|
+
|
146
|
+
<li><a href="../Log4r/GDC.html">Log4r::GDC</a></li>
|
147
|
+
|
148
|
+
<li><a href="../Log4r/IOOutputter.html">Log4r::IOOutputter</a></li>
|
149
|
+
|
150
|
+
<li><a href="../Log4r/Log4jXmlFormatter.html">Log4r::Log4jXmlFormatter</a></li>
|
151
|
+
|
152
|
+
<li><a href="../Log4r/Log4rTools.html">Log4r::Log4rTools</a></li>
|
153
|
+
|
154
|
+
<li><a href="../Log4r/LogEvent.html">Log4r::LogEvent</a></li>
|
155
|
+
|
156
|
+
<li><a href="../Log4r/LogServer.html">Log4r::LogServer</a></li>
|
157
|
+
|
158
|
+
<li><a href="../Log4r/Logger.html">Log4r::Logger</a></li>
|
159
|
+
|
160
|
+
<li><a href="../Log4r/MDC.html">Log4r::MDC</a></li>
|
161
|
+
|
162
|
+
<li><a href="../Log4r/NDC.html">Log4r::NDC</a></li>
|
163
|
+
|
164
|
+
<li><a href="../Log4r/ObjectFormatter.html">Log4r::ObjectFormatter</a></li>
|
165
|
+
|
166
|
+
<li><a href="../Log4r/Outputter.html">Log4r::Outputter</a></li>
|
167
|
+
|
168
|
+
<li><a href="../Log4r/PatternFormatter.html">Log4r::PatternFormatter</a></li>
|
169
|
+
|
170
|
+
<li><a href="../Log4r/RemoteOutputter.html">Log4r::RemoteOutputter</a></li>
|
171
|
+
|
172
|
+
<li><a href="../Log4r/RollingFileOutputter.html">Log4r::RollingFileOutputter</a></li>
|
173
|
+
|
174
|
+
<li><a href="../Log4r/RootLogger.html">Log4r::RootLogger</a></li>
|
175
|
+
|
176
|
+
<li><a href="../Log4r/SimpleFormatter.html">Log4r::SimpleFormatter</a></li>
|
177
|
+
|
178
|
+
<li><a href="../Log4r/StderrOutputter.html">Log4r::StderrOutputter</a></li>
|
179
|
+
|
180
|
+
<li><a href="../Log4r/StdoutOutputter.html">Log4r::StdoutOutputter</a></li>
|
181
|
+
|
182
|
+
<li><a href="../Log4r/SyslogOutputter.html">Log4r::SyslogOutputter</a></li>
|
183
|
+
|
184
|
+
<li><a href="../Log4r/UDPOutputter.html">Log4r::UDPOutputter</a></li>
|
185
|
+
|
186
|
+
<li><a href="../Log4r/YamlConfigurator.html">Log4r::YamlConfigurator</a></li>
|
187
|
+
|
188
|
+
</ul>
|
189
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
190
|
+
</div>
|
191
|
+
|
192
|
+
|
193
|
+
</div>
|
194
|
+
</div>
|
195
|
+
|
196
|
+
<div id="documentation">
|
197
|
+
<h1 class="class">Log4r::Formatter</h1>
|
198
|
+
|
199
|
+
<div id="description">
|
200
|
+
<p>
|
201
|
+
<a href="Formatter.html">Formatter</a> is an abstract class and a null
|
202
|
+
object
|
203
|
+
</p>
|
204
|
+
|
205
|
+
</div>
|
206
|
+
|
207
|
+
<!-- Constants -->
|
208
|
+
|
209
|
+
|
210
|
+
<!-- Attributes -->
|
211
|
+
|
212
|
+
|
213
|
+
<!-- Methods -->
|
214
|
+
|
215
|
+
<div id="public-class-method-details" class="method-section section">
|
216
|
+
<h3 class="section-header">Public Class Methods</h3>
|
217
|
+
|
218
|
+
|
219
|
+
<div id="new-method" class="method-detail ">
|
220
|
+
<a name="M000006"></a>
|
221
|
+
|
222
|
+
<div class="method-heading">
|
223
|
+
|
224
|
+
<span class="method-name">new</span><span
|
225
|
+
class="method-args">(hash={})</span>
|
226
|
+
<span class="method-click-advice">click to toggle source</span>
|
227
|
+
|
228
|
+
</div>
|
229
|
+
|
230
|
+
<div class="method-description">
|
231
|
+
|
232
|
+
<p class="missing-docs">(Not documented)</p>
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
<div class="method-source-code"
|
237
|
+
id="new-source">
|
238
|
+
<pre>
|
239
|
+
<span class="ruby-comment cmt"># File log4r/formatter/formatter.rb, line 13</span>
|
240
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">hash</span>={})
|
241
|
+
<span class="ruby-keyword kw">end</span></pre>
|
242
|
+
</div>
|
243
|
+
|
244
|
+
</div>
|
245
|
+
|
246
|
+
|
247
|
+
</div>
|
248
|
+
|
249
|
+
|
250
|
+
</div>
|
251
|
+
|
252
|
+
<div id="public-instance-method-details" class="method-section section">
|
253
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
254
|
+
|
255
|
+
|
256
|
+
<div id="format-method" class="method-detail ">
|
257
|
+
<a name="M000007"></a>
|
258
|
+
|
259
|
+
<div class="method-heading">
|
260
|
+
|
261
|
+
<span class="method-name">format</span><span
|
262
|
+
class="method-args">(logevent)</span>
|
263
|
+
<span class="method-click-advice">click to toggle source</span>
|
264
|
+
|
265
|
+
</div>
|
266
|
+
|
267
|
+
<div class="method-description">
|
268
|
+
|
269
|
+
<p>
|
270
|
+
Define this method in a subclass to format data.
|
271
|
+
</p>
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
<div class="method-source-code"
|
276
|
+
id="format-source">
|
277
|
+
<pre>
|
278
|
+
<span class="ruby-comment cmt"># File log4r/formatter/formatter.rb, line 16</span>
|
279
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">format</span>(<span class="ruby-identifier">logevent</span>)
|
280
|
+
<span class="ruby-keyword kw">end</span></pre>
|
281
|
+
</div>
|
282
|
+
|
283
|
+
</div>
|
284
|
+
|
285
|
+
|
286
|
+
</div>
|
287
|
+
|
288
|
+
|
289
|
+
</div>
|
290
|
+
|
291
|
+
|
292
|
+
</div>
|
293
|
+
|
294
|
+
|
295
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
296
|
+
|
297
|
+
<p>Disabled; run with --debug to generate this.</p>
|
298
|
+
|
299
|
+
</div>
|
300
|
+
|
301
|
+
<div id="validator-badges">
|
302
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
303
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
304
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
305
|
+
</div>
|
306
|
+
|
307
|
+
</body>
|
308
|
+
</html>
|
309
|
+
|