log4r 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. data/README +3 -3
  2. data/Rakefile +3 -3
  3. data/doc/rdoc-log4r.css +696 -0
  4. data/examples/syslogcustom.rb +6 -1
  5. data/src/doc/Log4r.html +392 -0
  6. data/src/doc/Log4r/BasicFormatter.html +370 -0
  7. data/src/doc/Log4r/ConfigError.html +207 -0
  8. data/src/doc/Log4r/Configurator.html +1050 -0
  9. data/src/doc/Log4r/DateFileOutputter.html +454 -0
  10. data/src/doc/Log4r/DefaultFormatter.html +205 -0
  11. data/src/doc/Log4r/EmailOutputter.html +636 -0
  12. data/src/doc/Log4r/FileOutputter.html +321 -0
  13. data/src/doc/Log4r/Formatter.html +291 -0
  14. data/src/doc/Log4r/IOOutputter.html +392 -0
  15. data/src/doc/Log4r/Log4rConfig.html +193 -0
  16. data/src/doc/Log4r/Log4rTools.html +370 -0
  17. data/src/doc/Log4r/LogEvent.html +360 -0
  18. data/src/doc/Log4r/LogServer.html +322 -0
  19. data/src/doc/Log4r/Logger.html +1132 -0
  20. data/src/doc/Log4r/Logger/LoggerFactory.html +200 -0
  21. data/src/doc/Log4r/Logger/Repository.html +207 -0
  22. data/src/doc/Log4r/ObjectFormatter.html +262 -0
  23. data/src/doc/Log4r/Outputter.html +910 -0
  24. data/src/doc/Log4r/Outputter/OutputterFactory.html +200 -0
  25. data/src/doc/Log4r/Outputter/consoleoutputters_rb.html +57 -0
  26. data/src/doc/Log4r/Outputter/datefileoutputter_rb.html +93 -0
  27. data/src/doc/Log4r/Outputter/emailoutputter_rb.html +179 -0
  28. data/src/doc/Log4r/Outputter/fileoutputter_rb.html +64 -0
  29. data/src/doc/Log4r/Outputter/iooutputter_rb.html +59 -0
  30. data/src/doc/Log4r/Outputter/outputter_rb.html +222 -0
  31. data/src/doc/Log4r/Outputter/outputterfactory_rb.html +62 -0
  32. data/src/doc/Log4r/Outputter/remoteoutputter_rb.html +59 -0
  33. data/src/doc/Log4r/Outputter/rollingfileoutputter_rb.html +66 -0
  34. data/src/doc/Log4r/Outputter/staticoutputter_rb.html +55 -0
  35. data/src/doc/Log4r/Outputter/syslogoutputter_rb.html +110 -0
  36. data/src/doc/Log4r/Outputter/tst_rb.html +54 -0
  37. data/src/doc/Log4r/PatternFormatter.html +422 -0
  38. data/src/doc/Log4r/ROMPClient.html +193 -0
  39. data/src/doc/Log4r/ROMPServer.html +193 -0
  40. data/src/doc/Log4r/RemoteOutputter.html +384 -0
  41. data/src/doc/Log4r/RollingFileOutputter.html +528 -0
  42. data/src/doc/Log4r/RootLogger.html +512 -0
  43. data/src/doc/Log4r/SimpleFormatter.html +258 -0
  44. data/src/doc/Log4r/StderrOutputter.html +250 -0
  45. data/src/doc/Log4r/StdoutOutputter.html +250 -0
  46. data/src/doc/Log4r/SyslogOutputter.html +533 -0
  47. data/src/doc/Log4r/YamlConfigurator.html +948 -0
  48. data/src/doc/Log4r/base_rb.html +57 -0
  49. data/src/doc/Log4r/config_rb.html +76 -0
  50. data/src/doc/Log4r/configurator_rb.html +370 -0
  51. data/src/doc/Log4r/formatter/formatter_rb.html +121 -0
  52. data/src/doc/Log4r/formatter/patternformatter_rb.html +233 -0
  53. data/src/doc/Log4r/lib/drbloader_rb.html +57 -0
  54. data/src/doc/Log4r/lib/xmlloader_rb.html +57 -0
  55. data/src/doc/Log4r/logevent_rb.html +55 -0
  56. data/src/doc/Log4r/logger_rb.html +293 -0
  57. data/src/doc/Log4r/loggerfactory_rb.html +66 -0
  58. data/src/doc/Log4r/logserver_rb.html +161 -0
  59. data/src/doc/Log4r/rdoc/configurator.html +444 -0
  60. data/src/doc/Log4r/rdoc/emailoutputter.html +261 -0
  61. data/src/doc/Log4r/rdoc/formatter.html +200 -0
  62. data/src/doc/Log4r/rdoc/log4r.html +268 -0
  63. data/src/doc/Log4r/rdoc/logger.html +364 -0
  64. data/src/doc/Log4r/rdoc/logserver.html +247 -0
  65. data/src/doc/Log4r/rdoc/outputter.html +295 -0
  66. data/src/doc/Log4r/rdoc/patternformatter.html +313 -0
  67. data/src/doc/Log4r/rdoc/syslogoutputter.html +179 -0
  68. data/src/doc/Log4r/rdoc/yamlconfigurator.html +169 -0
  69. data/src/doc/Log4r/repository_rb.html +62 -0
  70. data/src/doc/Log4r/staticlogger_rb.html +55 -0
  71. data/src/doc/Log4r/yamlconfigurator_rb.html +95 -0
  72. data/src/doc/REXML.html +193 -0
  73. data/src/doc/created.rid +1 -0
  74. data/src/doc/images/brick.png +0 -0
  75. data/src/doc/images/brick_link.png +0 -0
  76. data/src/doc/images/bug.png +0 -0
  77. data/src/doc/images/bullet_black.png +0 -0
  78. data/src/doc/images/bullet_toggle_minus.png +0 -0
  79. data/src/doc/images/bullet_toggle_plus.png +0 -0
  80. data/src/doc/images/date.png +0 -0
  81. data/src/doc/images/find.png +0 -0
  82. data/src/doc/images/loadingAnimation.gif +0 -0
  83. data/src/doc/images/macFFBgHack.png +0 -0
  84. data/src/doc/images/package.png +0 -0
  85. data/src/doc/images/page_green.png +0 -0
  86. data/src/doc/images/page_white_text.png +0 -0
  87. data/src/doc/images/page_white_width.png +0 -0
  88. data/src/doc/images/plugin.png +0 -0
  89. data/src/doc/images/ruby.png +0 -0
  90. data/src/doc/images/tag_green.png +0 -0
  91. data/src/doc/images/wrench.png +0 -0
  92. data/src/doc/images/wrench_orange.png +0 -0
  93. data/src/doc/images/zoom.png +0 -0
  94. data/src/doc/index.html +384 -0
  95. data/src/doc/js/darkfish.js +116 -0
  96. data/src/doc/js/jquery.js +32 -0
  97. data/src/doc/js/quicksearch.js +114 -0
  98. data/src/doc/js/thickbox-compressed.js +10 -0
  99. data/src/doc/rdoc.css +696 -0
  100. data/src/log4r.rb +2 -2
  101. data/src/log4r/formatter/patternformatter.rb +18 -2
  102. data/src/log4r/logger.rb +2 -2
  103. data/src/log4r/outputter/emailoutputter.rb +2 -0
  104. data/src/log4r/outputter/syslogoutputter.rb +29 -9
  105. data/src/log4r/outputter/tst.rb +8 -0
  106. metadata +99 -3
  107. data/examples/logs/simple.log +0 -1
@@ -0,0 +1,528 @@
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::RollingFileOutputter</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/rollingfileoutputter_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
32
+ class="thickbox" title="log4r/outputter/rollingfileoutputter.rb">log4r/outputter/rollingfileoutputter.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">FileOutputter</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="#M000092">::new</a></li>
63
+
64
+ <li><a href="#M000100">#makeNewFilename</a></li>
65
+
66
+ <li><a href="#M000101">#requiresRoll</a></li>
67
+
68
+ <li><a href="#M000102">#roll</a></li>
69
+
70
+ <li><a href="#M000097">#write</a></li>
71
+
72
+ </ul>
73
+ </div>
74
+
75
+
76
+ <!-- Included Modules -->
77
+
78
+ </div>
79
+
80
+ <div id="project-metadata">
81
+
82
+
83
+ <div id="fileindex-section" class="section project-section">
84
+ <h3 class="section-header">Files</h3>
85
+ <ul>
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/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/IOOutputter.html">Log4r::IOOutputter</a></li>
145
+
146
+ <li><a href="../Log4r/Log4rTools.html">Log4r::Log4rTools</a></li>
147
+
148
+ <li><a href="../Log4r/LogEvent.html">Log4r::LogEvent</a></li>
149
+
150
+ <li><a href="../Log4r/LogServer.html">Log4r::LogServer</a></li>
151
+
152
+ <li><a href="../Log4r/Logger.html">Log4r::Logger</a></li>
153
+
154
+ <li><a href="../Log4r/ObjectFormatter.html">Log4r::ObjectFormatter</a></li>
155
+
156
+ <li><a href="../Log4r/Outputter.html">Log4r::Outputter</a></li>
157
+
158
+ <li><a href="../Log4r/PatternFormatter.html">Log4r::PatternFormatter</a></li>
159
+
160
+ <li><a href="../Log4r/RemoteOutputter.html">Log4r::RemoteOutputter</a></li>
161
+
162
+ <li><a href="../Log4r/RollingFileOutputter.html">Log4r::RollingFileOutputter</a></li>
163
+
164
+ <li><a href="../Log4r/RootLogger.html">Log4r::RootLogger</a></li>
165
+
166
+ <li><a href="../Log4r/SimpleFormatter.html">Log4r::SimpleFormatter</a></li>
167
+
168
+ <li><a href="../Log4r/StderrOutputter.html">Log4r::StderrOutputter</a></li>
169
+
170
+ <li><a href="../Log4r/StdoutOutputter.html">Log4r::StdoutOutputter</a></li>
171
+
172
+ <li><a href="../Log4r/SyslogOutputter.html">Log4r::SyslogOutputter</a></li>
173
+
174
+ <li><a href="../Log4r/YamlConfigurator.html">Log4r::YamlConfigurator</a></li>
175
+
176
+ </ul>
177
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
178
+ </div>
179
+
180
+
181
+ </div>
182
+ </div>
183
+
184
+ <div id="documentation">
185
+ <h1 class="class">Log4r::RollingFileOutputter</h1>
186
+
187
+ <div id="description">
188
+ <p>
189
+ <a href="RollingFileOutputter.html">RollingFileOutputter</a> - subclass of
190
+ <a href="FileOutputter.html">FileOutputter</a> that rolls files on size or
191
+ time. Additional hash arguments are:
192
+ </p>
193
+ <dl>
194
+ <dt><tt>:maxsize</tt></dt><dd>Maximum size of the file in bytes.
195
+
196
+ </dd>
197
+ <dt><tt>:trunc</tt></dt><dd>Maximum age of the file in seconds.
198
+
199
+ </dd>
200
+ </dl>
201
+
202
+ </div>
203
+
204
+ <!-- Constants -->
205
+
206
+
207
+ <!-- Attributes -->
208
+
209
+ <div id="attribute-method-details" class="method-section section">
210
+ <h3 class="section-header">Attributes</h3>
211
+
212
+
213
+ <div id="count-attribute-method" class="method-detail">
214
+ <a name="count"></a>
215
+
216
+ <div class="method-heading attribute-method-heading">
217
+ <span class="method-name">count</span><span
218
+ class="attribute-access-type">[R]</span>
219
+ </div>
220
+
221
+ <div class="method-description">
222
+
223
+ <p class="missing-docs">(Not documented)</p>
224
+
225
+ </div>
226
+ </div>
227
+
228
+ <div id="maxsize-attribute-method" class="method-detail">
229
+ <a name="maxsize"></a>
230
+
231
+ <div class="method-heading attribute-method-heading">
232
+ <span class="method-name">maxsize</span><span
233
+ class="attribute-access-type">[R]</span>
234
+ </div>
235
+
236
+ <div class="method-description">
237
+
238
+ <p class="missing-docs">(Not documented)</p>
239
+
240
+ </div>
241
+ </div>
242
+
243
+ <div id="maxtime-attribute-method" class="method-detail">
244
+ <a name="maxtime"></a>
245
+
246
+ <div class="method-heading attribute-method-heading">
247
+ <span class="method-name">maxtime</span><span
248
+ class="attribute-access-type">[R]</span>
249
+ </div>
250
+
251
+ <div class="method-description">
252
+
253
+ <p class="missing-docs">(Not documented)</p>
254
+
255
+ </div>
256
+ </div>
257
+
258
+ <div id="start-ime-attribute-method" class="method-detail">
259
+ <a name="startTime"></a>
260
+
261
+ <div class="method-heading attribute-method-heading">
262
+ <span class="method-name">startTime</span><span
263
+ class="attribute-access-type">[R]</span>
264
+ </div>
265
+
266
+ <div class="method-description">
267
+
268
+ <p class="missing-docs">(Not documented)</p>
269
+
270
+ </div>
271
+ </div>
272
+
273
+ </div>
274
+
275
+
276
+ <!-- Methods -->
277
+
278
+ <div id="public-class-method-details" class="method-section section">
279
+ <h3 class="section-header">Public Class Methods</h3>
280
+
281
+
282
+ <div id="new-method" class="method-detail ">
283
+ <a name="M000092"></a>
284
+
285
+ <div class="method-heading">
286
+
287
+ <span class="method-name">new</span><span
288
+ class="method-args">(_name, hash={})</span>
289
+ <span class="method-click-advice">click to toggle source</span>
290
+
291
+ </div>
292
+
293
+ <div class="method-description">
294
+
295
+ <p class="missing-docs">(Not documented)</p>
296
+
297
+
298
+
299
+ <div class="method-source-code"
300
+ id="new-source">
301
+ <pre>
302
+ <span class="ruby-comment cmt"># File log4r/outputter/rollingfileoutputter.rb, line 19</span>
303
+ <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>={})
304
+ <span class="ruby-ivar">@count</span> = <span class="ruby-value">0</span>
305
+ <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">_name</span>, <span class="ruby-identifier">hash</span>)
306
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">:maxsize</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-value str">'maxsize'</span>)
307
+ <span class="ruby-identifier">_maxsize</span> = (<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:maxsize</span>] <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'maxsize'</span>]).<span class="ruby-identifier">to_i</span>
308
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">_maxsize</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">Fixnum</span>
309
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-value str">&quot;Argument 'maxsize' must be an Fixnum&quot;</span>, <span class="ruby-identifier">caller</span>
310
+ <span class="ruby-keyword kw">end</span>
311
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">_maxsize</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
312
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-value str">&quot;Argument 'maxsize' must be &gt; 0&quot;</span>, <span class="ruby-identifier">caller</span>
313
+ <span class="ruby-keyword kw">end</span>
314
+ <span class="ruby-ivar">@maxsize</span> = <span class="ruby-identifier">_maxsize</span>
315
+ <span class="ruby-keyword kw">end</span>
316
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">:maxtime</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-value str">'maxtime'</span>)
317
+ <span class="ruby-identifier">_maxtime</span> = (<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:maxtime</span>] <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'maxtime'</span>]).<span class="ruby-identifier">to_i</span>
318
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">_maxtime</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">Fixnum</span>
319
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-value str">&quot;Argument 'maxtime' must be an Fixnum&quot;</span>, <span class="ruby-identifier">caller</span>
320
+ <span class="ruby-keyword kw">end</span>
321
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">_maxtime</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
322
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-value str">&quot;Argument 'maxtime' must be &gt; 0&quot;</span>, <span class="ruby-identifier">caller</span>
323
+ <span class="ruby-keyword kw">end</span>
324
+ <span class="ruby-ivar">@maxtime</span> = <span class="ruby-identifier">_maxtime</span>
325
+ <span class="ruby-ivar">@startTime</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
326
+ <span class="ruby-keyword kw">end</span>
327
+ <span class="ruby-ivar">@baseFilename</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-ivar">@filename</span>)
328
+ <span class="ruby-comment cmt"># roll immediately so all files are of the form &quot;000001-@baseFilename&quot;</span>
329
+ <span class="ruby-identifier">roll</span>
330
+ <span class="ruby-comment cmt"># initialize the file size counter</span>
331
+ <span class="ruby-ivar">@datasize</span> = <span class="ruby-value">0</span>
332
+ <span class="ruby-keyword kw">end</span></pre>
333
+ </div>
334
+
335
+ </div>
336
+
337
+
338
+ </div>
339
+
340
+
341
+ </div>
342
+
343
+ <div id="private-instance-method-details" class="method-section section">
344
+ <h3 class="section-header">Private Instance Methods</h3>
345
+
346
+
347
+ <div id="make-ew-ilename-method" class="method-detail ">
348
+ <a name="M000100"></a>
349
+
350
+ <div class="method-heading">
351
+
352
+ <span class="method-name">makeNewFilename</span><span
353
+ class="method-args">()</span>
354
+ <span class="method-click-advice">click to toggle source</span>
355
+
356
+ </div>
357
+
358
+ <div class="method-description">
359
+
360
+ <p>
361
+ construct a new filename from the count and baseFilname
362
+ </p>
363
+
364
+
365
+
366
+ <div class="method-source-code"
367
+ id="make-ew-ilename-source">
368
+ <pre>
369
+ <span class="ruby-comment cmt"># File log4r/outputter/rollingfileoutputter.rb, line 64</span>
370
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">makeNewFilename</span>
371
+ <span class="ruby-comment cmt"># note use of hard coded 6 digit counter width - is this enough files?</span>
372
+ <span class="ruby-identifier">pad</span> = <span class="ruby-value str">&quot;0&quot;</span> <span class="ruby-operator">*</span> (<span class="ruby-value">6</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@count</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">length</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">count</span>.<span class="ruby-identifier">to_s</span>
373
+ <span class="ruby-identifier">newbase</span> = <span class="ruby-ivar">@baseFilename</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/(\.\w*)$/</span>, <span class="ruby-identifier">pad</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'\1'</span>)
374
+ <span class="ruby-ivar">@filename</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-ivar">@filename</span>), <span class="ruby-identifier">newbase</span>)
375
+ <span class="ruby-constant">Logger</span>.<span class="ruby-identifier">log_internal</span> {<span class="ruby-node">&quot;File #{@filename} created&quot;</span>}
376
+ <span class="ruby-keyword kw">end</span></pre>
377
+ </div>
378
+
379
+ </div>
380
+
381
+
382
+ </div>
383
+
384
+
385
+ <div id="requires-oll-method" class="method-detail ">
386
+ <a name="M000101"></a>
387
+
388
+ <div class="method-heading">
389
+
390
+ <span class="method-name">requiresRoll</span><span
391
+ class="method-args">()</span>
392
+ <span class="method-click-advice">click to toggle source</span>
393
+
394
+ </div>
395
+
396
+ <div class="method-description">
397
+
398
+ <p>
399
+ does the file require a roll?
400
+ </p>
401
+
402
+
403
+
404
+ <div class="method-source-code"
405
+ id="requires-oll-source">
406
+ <pre>
407
+ <span class="ruby-comment cmt"># File log4r/outputter/rollingfileoutputter.rb, line 73</span>
408
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">requiresRoll</span>
409
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@maxsize</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@datasize</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@maxsize</span>
410
+ <span class="ruby-ivar">@datasize</span> = <span class="ruby-value">0</span>
411
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
412
+ <span class="ruby-keyword kw">end</span>
413
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@maxtime</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@startTime</span>) <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@maxtime</span>
414
+ <span class="ruby-ivar">@startTime</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
415
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
416
+ <span class="ruby-keyword kw">end</span>
417
+ <span class="ruby-keyword kw">false</span>
418
+ <span class="ruby-keyword kw">end</span></pre>
419
+ </div>
420
+
421
+ </div>
422
+
423
+
424
+ </div>
425
+
426
+
427
+ <div id="roll-method" class="method-detail ">
428
+ <a name="M000102"></a>
429
+
430
+ <div class="method-heading">
431
+
432
+ <span class="method-name">roll</span><span
433
+ class="method-args">()</span>
434
+ <span class="method-click-advice">click to toggle source</span>
435
+
436
+ </div>
437
+
438
+ <div class="method-description">
439
+
440
+ <p>
441
+ roll the file
442
+ </p>
443
+
444
+
445
+
446
+ <div class="method-source-code"
447
+ id="roll-source">
448
+ <pre>
449
+ <span class="ruby-comment cmt"># File log4r/outputter/rollingfileoutputter.rb, line 86</span>
450
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">roll</span>
451
+ <span class="ruby-keyword kw">begin</span>
452
+ <span class="ruby-ivar">@out</span>.<span class="ruby-identifier">close</span>
453
+ <span class="ruby-keyword kw">rescue</span>
454
+ <span class="ruby-constant">Logger</span>.<span class="ruby-identifier">log_internal</span> {
455
+ <span class="ruby-node">&quot;RollingFileOutputter '#{@name}' could not close #{@filename}&quot;</span>
456
+ }
457
+ <span class="ruby-keyword kw">end</span>
458
+ <span class="ruby-ivar">@count</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
459
+ <span class="ruby-identifier">makeNewFilename</span>
460
+ <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">&quot;w&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;a&quot;</span>))
461
+ <span class="ruby-keyword kw">end</span></pre>
462
+ </div>
463
+
464
+ </div>
465
+
466
+
467
+ </div>
468
+
469
+
470
+ <div id="write-method" class="method-detail ">
471
+ <a name="M000097"></a>
472
+
473
+ <div class="method-heading">
474
+
475
+ <span class="method-name">write</span><span
476
+ class="method-args">(data)</span>
477
+ <span class="method-click-advice">click to toggle source</span>
478
+
479
+ </div>
480
+
481
+ <div class="method-description">
482
+
483
+ <p>
484
+ perform the write
485
+ </p>
486
+
487
+
488
+
489
+ <div class="method-source-code"
490
+ id="write-source">
491
+ <pre>
492
+ <span class="ruby-comment cmt"># File log4r/outputter/rollingfileoutputter.rb, line 55</span>
493
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write</span>(<span class="ruby-identifier">data</span>)
494
+ <span class="ruby-comment cmt"># we have to keep track of the file size ourselves - File.size doesn't</span>
495
+ <span class="ruby-comment cmt"># seem to report the correct size when the size changes rapidly</span>
496
+ <span class="ruby-ivar">@datasize</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span> <span class="ruby-comment cmt"># the 1 is for newline</span>
497
+ <span class="ruby-keyword kw">super</span>
498
+ <span class="ruby-identifier">roll</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">requiresRoll</span>
499
+ <span class="ruby-keyword kw">end</span></pre>
500
+ </div>
501
+
502
+ </div>
503
+
504
+
505
+ </div>
506
+
507
+
508
+ </div>
509
+
510
+
511
+ </div>
512
+
513
+
514
+ <div id="rdoc-debugging-section-dump" class="debugging-section">
515
+
516
+ <p>Disabled; run with --debug to generate this.</p>
517
+
518
+ </div>
519
+
520
+ <div id="validator-badges">
521
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
522
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
523
+ Rdoc Generator</a> 1.1.6</small>.</p>
524
+ </div>
525
+
526
+ </body>
527
+ </html>
528
+