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,110 @@
|
|
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
|
+
|
5
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
6
|
+
<head>
|
7
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
8
|
+
|
9
|
+
<title>File: NDC.rb [1.1.7 Log4r API]</title>
|
10
|
+
|
11
|
+
<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet" />
|
12
|
+
|
13
|
+
<script src="../js/jquery.js" type="text/javascript"
|
14
|
+
charset="utf-8"></script>
|
15
|
+
<script src="../js/thickbox-compressed.js" type="text/javascript"
|
16
|
+
charset="utf-8"></script>
|
17
|
+
<script src="../js/quicksearch.js" type="text/javascript"
|
18
|
+
charset="utf-8"></script>
|
19
|
+
<script src="../js/darkfish.js" type="text/javascript"
|
20
|
+
charset="utf-8"></script>
|
21
|
+
</head>
|
22
|
+
|
23
|
+
<body class="file file-popup">
|
24
|
+
<div id="metadata">
|
25
|
+
<dl>
|
26
|
+
<dt class="modified-date">Last Modified</dt>
|
27
|
+
<dd class="modified-date">Tue Feb 02 21:20:05 -0800 2010</dd>
|
28
|
+
|
29
|
+
|
30
|
+
<dt class="requires">Requires</dt>
|
31
|
+
<dd class="requires">
|
32
|
+
<ul>
|
33
|
+
|
34
|
+
</ul>
|
35
|
+
</dd>
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
</dl>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
<div id="documentation">
|
43
|
+
|
44
|
+
<div class="description">
|
45
|
+
<h2>Description</h2>
|
46
|
+
<h1>NDC</h1>
|
47
|
+
<p>
|
48
|
+
The NDC class implements a copy of the Nested Diagnostic Context, which is
|
49
|
+
part of the Apache Log4j library. Nested Diagnostic Contexts were derived
|
50
|
+
from Neil Harrison’s article on “Patterns for Logging
|
51
|
+
Diagnostic Messages”, part of the book “Pattern Languages of
|
52
|
+
Program Design 3” edited by Martin et al.
|
53
|
+
</p>
|
54
|
+
<p>
|
55
|
+
NDCs in <a href="../Log4r.html">Log4r</a> are thread safe.
|
56
|
+
</p>
|
57
|
+
<p>
|
58
|
+
NDCs in log4r are close enough to NDCs in Log4j that I include its
|
59
|
+
documentation directly:
|
60
|
+
</p>
|
61
|
+
<p>
|
62
|
+
… A Nested Diagnostic Context, or NDC in short, is an instrument to
|
63
|
+
distinguish interleaved log output from different sources. Log output is
|
64
|
+
typically interleaved when a server handles multiple clients
|
65
|
+
near-simultaneously.
|
66
|
+
</p>
|
67
|
+
<p>
|
68
|
+
Interleaved log output can still be meaningful if each log entry from
|
69
|
+
different contexts had a distinctive stamp. This is where NDCs come into
|
70
|
+
play.
|
71
|
+
</p>
|
72
|
+
<p>
|
73
|
+
Note that NDCs are managed on a per thread basis. NDC operations such as
|
74
|
+
push, pop(), clear(), getDepth() and setMaxDepth(int) affect the NDC of the
|
75
|
+
current thread only. NDCs of other threads remain unaffected. …
|
76
|
+
</p>
|
77
|
+
<p>
|
78
|
+
An important difference between NDCs in <a href="../Log4r.html">Log4r</a>
|
79
|
+
vs Log4j is that you do not have to called NDC.remove() when exiting a
|
80
|
+
thread.
|
81
|
+
</p>
|
82
|
+
<p>
|
83
|
+
This class will automatically create Thread specific storage for the
|
84
|
+
current thread on the first call to any of its methods, i.e.
|
85
|
+
</p>
|
86
|
+
<pre>
|
87
|
+
NDC.push( "client accept" );
|
88
|
+
</pre>
|
89
|
+
<p>
|
90
|
+
New threads may inherit the NDC of the parent thread by making use of the
|
91
|
+
clone_stack() and inherit() methods. By default, the NDC is not inherited
|
92
|
+
automatically. This is unlike MDCs, which will inherit from the main
|
93
|
+
thread.
|
94
|
+
</p>
|
95
|
+
<h2>Other Info</h2>
|
96
|
+
<table>
|
97
|
+
<tr><td valign="top">Version:</td><td>$Id: NDC.rb,v 1.5 2010/02/03 05:20:05 colbygk Exp $
|
98
|
+
|
99
|
+
</td></tr>
|
100
|
+
<tr><td valign="top">Author:</td><td>Colby Gutierrez-Kraybill <colby(at)astro.berkeley.edu>
|
101
|
+
|
102
|
+
</td></tr>
|
103
|
+
</table>
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
</div>
|
108
|
+
</body>
|
109
|
+
</html>
|
110
|
+
|
@@ -0,0 +1,280 @@
|
|
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::ObjectFormatter</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">Formatter</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="#M000019">#format</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::ObjectFormatter</h1>
|
196
|
+
|
197
|
+
<div id="description">
|
198
|
+
<p>
|
199
|
+
Formats objects the same way irb does:
|
200
|
+
</p>
|
201
|
+
<pre>
|
202
|
+
loggername:foo.rb in 12>
|
203
|
+
[1, 3, 4]
|
204
|
+
loggername:foo.rb in 13>
|
205
|
+
{1=>"1"}
|
206
|
+
</pre>
|
207
|
+
<p>
|
208
|
+
Strings don’t get inspected. just printed. The trace is optional.
|
209
|
+
</p>
|
210
|
+
|
211
|
+
</div>
|
212
|
+
|
213
|
+
<!-- Constants -->
|
214
|
+
|
215
|
+
|
216
|
+
<!-- Attributes -->
|
217
|
+
|
218
|
+
|
219
|
+
<!-- Methods -->
|
220
|
+
|
221
|
+
<div id="public-instance-method-details" class="method-section section">
|
222
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
223
|
+
|
224
|
+
|
225
|
+
<div id="format-method" class="method-detail ">
|
226
|
+
<a name="M000019"></a>
|
227
|
+
|
228
|
+
<div class="method-heading">
|
229
|
+
|
230
|
+
<span class="method-name">format</span><span
|
231
|
+
class="method-args">(event)</span>
|
232
|
+
<span class="method-click-advice">click to toggle source</span>
|
233
|
+
|
234
|
+
</div>
|
235
|
+
|
236
|
+
<div class="method-description">
|
237
|
+
|
238
|
+
<p class="missing-docs">(Not documented)</p>
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
<div class="method-source-code"
|
243
|
+
id="format-source">
|
244
|
+
<pre>
|
245
|
+
<span class="ruby-comment cmt"># File log4r/formatter/formatter.rb, line 92</span>
|
246
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">format</span>(<span class="ruby-identifier">event</span>)
|
247
|
+
<span class="ruby-identifier">buff</span> = <span class="ruby-identifier">event</span>.<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">name</span>
|
248
|
+
<span class="ruby-identifier">buff</span> <span class="ruby-operator"><<</span> (<span class="ruby-identifier">event</span>.<span class="ruby-identifier">tracer</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-value">? </span><span class="ruby-value str">""</span> <span class="ruby-operator">:</span> <span class="ruby-node">":#{event.tracer[0]}"</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">">\n"</span>
|
249
|
+
<span class="ruby-identifier">buff</span> <span class="ruby-operator"><<</span> (<span class="ruby-identifier">event</span>.<span class="ruby-identifier">data</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">String</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">event</span>.<span class="ruby-identifier">data</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">event</span>.<span class="ruby-identifier">data</span>.<span class="ruby-identifier">inspect</span>)
|
250
|
+
<span class="ruby-identifier">buff</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\n"</span>
|
251
|
+
<span class="ruby-keyword kw">end</span></pre>
|
252
|
+
</div>
|
253
|
+
|
254
|
+
</div>
|
255
|
+
|
256
|
+
|
257
|
+
</div>
|
258
|
+
|
259
|
+
|
260
|
+
</div>
|
261
|
+
|
262
|
+
|
263
|
+
</div>
|
264
|
+
|
265
|
+
|
266
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
267
|
+
|
268
|
+
<p>Disabled; run with --debug to generate this.</p>
|
269
|
+
|
270
|
+
</div>
|
271
|
+
|
272
|
+
<div id="validator-badges">
|
273
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
274
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
275
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
276
|
+
</div>
|
277
|
+
|
278
|
+
</body>
|
279
|
+
</html>
|
280
|
+
|
@@ -0,0 +1,934 @@
|
|
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/outputterfactory_rb.html?TB_iframe=true&height=550&width=785"
|
35
|
+
class="thickbox" title="log4r/outputter/outputterfactory.rb">log4r/outputter/outputterfactory.rb</a></li>
|
36
|
+
|
37
|
+
<li><a href="../log4r/outputter/staticoutputter_rb.html?TB_iframe=true&height=550&width=785"
|
38
|
+
class="thickbox" title="log4r/outputter/staticoutputter.rb">log4r/outputter/staticoutputter.rb</a></li>
|
39
|
+
|
40
|
+
</ul>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<div id="class-metadata">
|
48
|
+
|
49
|
+
<!-- Parent Class -->
|
50
|
+
|
51
|
+
<div id="parent-class-section" class="section">
|
52
|
+
<h3 class="section-header">Parent</h3>
|
53
|
+
|
54
|
+
<p class="link">Object</p>
|
55
|
+
|
56
|
+
</div>
|
57
|
+
|
58
|
+
|
59
|
+
<!-- Namespace Contents -->
|
60
|
+
|
61
|
+
<div id="namespace-list-section" class="section">
|
62
|
+
<h3 class="section-header">Namespace</h3>
|
63
|
+
<ul class="link-list">
|
64
|
+
|
65
|
+
<li><span class="type">CLASS</span> <a href="Outputter/OutputterFactory.html">Log4r::Outputter::OutputterFactory</a></li>
|
66
|
+
|
67
|
+
</ul>
|
68
|
+
</div>
|
69
|
+
|
70
|
+
|
71
|
+
<!-- Method Quickref -->
|
72
|
+
|
73
|
+
<div id="method-list-section" class="section">
|
74
|
+
<h3 class="section-header">Methods</h3>
|
75
|
+
<ul class="link-list">
|
76
|
+
|
77
|
+
<li><a href="#M000115">::[]</a></li>
|
78
|
+
|
79
|
+
<li><a href="#M000118">::[]=</a></li>
|
80
|
+
|
81
|
+
<li><a href="#M000121">::each</a></li>
|
82
|
+
|
83
|
+
<li><a href="#M000122">::each_outputter</a></li>
|
84
|
+
|
85
|
+
<li><a href="#M000098">::new</a></li>
|
86
|
+
|
87
|
+
<li><a href="#M000117">::stderr</a></li>
|
88
|
+
|
89
|
+
<li><a href="#M000116">::stdout</a></li>
|
90
|
+
|
91
|
+
<li><a href="#M000104">#canonical_log</a></li>
|
92
|
+
|
93
|
+
<li><a href="#M000102">#flush</a></li>
|
94
|
+
|
95
|
+
<li><a href="#M000105">#format</a></li>
|
96
|
+
|
97
|
+
<li><a href="#M000101">#formatter=</a></li>
|
98
|
+
|
99
|
+
<li><a href="#M000099">#level=</a></li>
|
100
|
+
|
101
|
+
<li><a href="#M000100">#only_at</a></li>
|
102
|
+
|
103
|
+
<li><a href="#M000107">#synch</a></li>
|
104
|
+
|
105
|
+
<li><a href="#M000103">#validate_hash</a></li>
|
106
|
+
|
107
|
+
<li><a href="#M000106">#write</a></li>
|
108
|
+
|
109
|
+
</ul>
|
110
|
+
</div>
|
111
|
+
|
112
|
+
|
113
|
+
<!-- Included Modules -->
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
<div id="project-metadata">
|
118
|
+
|
119
|
+
|
120
|
+
<div id="fileindex-section" class="section project-section">
|
121
|
+
<h3 class="section-header">Files</h3>
|
122
|
+
<ul>
|
123
|
+
|
124
|
+
<li class="file"><a href="../log4r/rdoc/GDC.html">GDC</a></li>
|
125
|
+
|
126
|
+
<li class="file"><a href="../log4r/rdoc/MDC.html">MDC</a></li>
|
127
|
+
|
128
|
+
<li class="file"><a href="../log4r/rdoc/NDC.html">NDC</a></li>
|
129
|
+
|
130
|
+
<li class="file"><a href="../log4r/rdoc/configurator.html">configurator</a></li>
|
131
|
+
|
132
|
+
<li class="file"><a href="../log4r/rdoc/emailoutputter.html">emailoutputter</a></li>
|
133
|
+
|
134
|
+
<li class="file"><a href="../log4r/rdoc/formatter.html">formatter</a></li>
|
135
|
+
|
136
|
+
<li class="file"><a href="../log4r/rdoc/log4r.html">log4r</a></li>
|
137
|
+
|
138
|
+
<li class="file"><a href="../log4r/rdoc/logger.html">logger</a></li>
|
139
|
+
|
140
|
+
<li class="file"><a href="../log4r/rdoc/logserver.html">logserver</a></li>
|
141
|
+
|
142
|
+
<li class="file"><a href="../log4r/rdoc/outputter.html">outputter</a></li>
|
143
|
+
|
144
|
+
<li class="file"><a href="../log4r/rdoc/patternformatter.html">patternformatter</a></li>
|
145
|
+
|
146
|
+
<li class="file"><a href="../log4r/rdoc/syslogoutputter.html">syslogoutputter</a></li>
|
147
|
+
|
148
|
+
<li class="file"><a href="../log4r/rdoc/win32eventoutputter.html">win32eventoutputter</a></li>
|
149
|
+
|
150
|
+
<li class="file"><a href="../log4r/rdoc/yamlconfigurator.html">yamlconfigurator</a></li>
|
151
|
+
|
152
|
+
</ul>
|
153
|
+
</div>
|
154
|
+
|
155
|
+
|
156
|
+
<div id="classindex-section" class="section project-section">
|
157
|
+
<h3 class="section-header">Class Index
|
158
|
+
<span class="search-toggle"><img src="../images/find.png"
|
159
|
+
height="16" width="16" alt="[+]"
|
160
|
+
title="show/hide quicksearch" /></span></h3>
|
161
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
162
|
+
<fieldset>
|
163
|
+
<legend>Quicksearch</legend>
|
164
|
+
<input type="text" name="quicksearch" value=""
|
165
|
+
class="quicksearch-field" />
|
166
|
+
</fieldset>
|
167
|
+
</form>
|
168
|
+
|
169
|
+
<ul class="link-list">
|
170
|
+
|
171
|
+
<li><a href="../Log4r.html">Log4r</a></li>
|
172
|
+
|
173
|
+
<li><a href="../Log4r/BasicFormatter.html">Log4r::BasicFormatter</a></li>
|
174
|
+
|
175
|
+
<li><a href="../Log4r/ConfigError.html">Log4r::ConfigError</a></li>
|
176
|
+
|
177
|
+
<li><a href="../Log4r/Configurator.html">Log4r::Configurator</a></li>
|
178
|
+
|
179
|
+
<li><a href="../Log4r/DateFileOutputter.html">Log4r::DateFileOutputter</a></li>
|
180
|
+
|
181
|
+
<li><a href="../Log4r/DefaultFormatter.html">Log4r::DefaultFormatter</a></li>
|
182
|
+
|
183
|
+
<li><a href="../Log4r/EmailOutputter.html">Log4r::EmailOutputter</a></li>
|
184
|
+
|
185
|
+
<li><a href="../Log4r/FileOutputter.html">Log4r::FileOutputter</a></li>
|
186
|
+
|
187
|
+
<li><a href="../Log4r/Formatter.html">Log4r::Formatter</a></li>
|
188
|
+
|
189
|
+
<li><a href="../Log4r/GDC.html">Log4r::GDC</a></li>
|
190
|
+
|
191
|
+
<li><a href="../Log4r/IOOutputter.html">Log4r::IOOutputter</a></li>
|
192
|
+
|
193
|
+
<li><a href="../Log4r/Log4jXmlFormatter.html">Log4r::Log4jXmlFormatter</a></li>
|
194
|
+
|
195
|
+
<li><a href="../Log4r/Log4rTools.html">Log4r::Log4rTools</a></li>
|
196
|
+
|
197
|
+
<li><a href="../Log4r/LogEvent.html">Log4r::LogEvent</a></li>
|
198
|
+
|
199
|
+
<li><a href="../Log4r/LogServer.html">Log4r::LogServer</a></li>
|
200
|
+
|
201
|
+
<li><a href="../Log4r/Logger.html">Log4r::Logger</a></li>
|
202
|
+
|
203
|
+
<li><a href="../Log4r/MDC.html">Log4r::MDC</a></li>
|
204
|
+
|
205
|
+
<li><a href="../Log4r/NDC.html">Log4r::NDC</a></li>
|
206
|
+
|
207
|
+
<li><a href="../Log4r/ObjectFormatter.html">Log4r::ObjectFormatter</a></li>
|
208
|
+
|
209
|
+
<li><a href="../Log4r/Outputter.html">Log4r::Outputter</a></li>
|
210
|
+
|
211
|
+
<li><a href="../Log4r/PatternFormatter.html">Log4r::PatternFormatter</a></li>
|
212
|
+
|
213
|
+
<li><a href="../Log4r/RemoteOutputter.html">Log4r::RemoteOutputter</a></li>
|
214
|
+
|
215
|
+
<li><a href="../Log4r/RollingFileOutputter.html">Log4r::RollingFileOutputter</a></li>
|
216
|
+
|
217
|
+
<li><a href="../Log4r/RootLogger.html">Log4r::RootLogger</a></li>
|
218
|
+
|
219
|
+
<li><a href="../Log4r/SimpleFormatter.html">Log4r::SimpleFormatter</a></li>
|
220
|
+
|
221
|
+
<li><a href="../Log4r/StderrOutputter.html">Log4r::StderrOutputter</a></li>
|
222
|
+
|
223
|
+
<li><a href="../Log4r/StdoutOutputter.html">Log4r::StdoutOutputter</a></li>
|
224
|
+
|
225
|
+
<li><a href="../Log4r/SyslogOutputter.html">Log4r::SyslogOutputter</a></li>
|
226
|
+
|
227
|
+
<li><a href="../Log4r/UDPOutputter.html">Log4r::UDPOutputter</a></li>
|
228
|
+
|
229
|
+
<li><a href="../Log4r/YamlConfigurator.html">Log4r::YamlConfigurator</a></li>
|
230
|
+
|
231
|
+
</ul>
|
232
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
233
|
+
</div>
|
234
|
+
|
235
|
+
|
236
|
+
</div>
|
237
|
+
</div>
|
238
|
+
|
239
|
+
<div id="documentation">
|
240
|
+
<h1 class="class">Log4r::Outputter</h1>
|
241
|
+
|
242
|
+
<div id="description">
|
243
|
+
|
244
|
+
</div>
|
245
|
+
|
246
|
+
<!-- Constants -->
|
247
|
+
|
248
|
+
|
249
|
+
<!-- Attributes -->
|
250
|
+
|
251
|
+
<div id="attribute-method-details" class="method-section section">
|
252
|
+
<h3 class="section-header">Attributes</h3>
|
253
|
+
|
254
|
+
|
255
|
+
<div id="name-attribute-method" class="method-detail">
|
256
|
+
<a name="name"></a>
|
257
|
+
|
258
|
+
<div class="method-heading attribute-method-heading">
|
259
|
+
<span class="method-name">name</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 id="level-attribute-method" class="method-detail">
|
271
|
+
<a name="level"></a>
|
272
|
+
|
273
|
+
<div class="method-heading attribute-method-heading">
|
274
|
+
<span class="method-name">level</span><span
|
275
|
+
class="attribute-access-type">[R]</span>
|
276
|
+
</div>
|
277
|
+
|
278
|
+
<div class="method-description">
|
279
|
+
|
280
|
+
<p class="missing-docs">(Not documented)</p>
|
281
|
+
|
282
|
+
</div>
|
283
|
+
</div>
|
284
|
+
|
285
|
+
<div id="formatter-attribute-method" class="method-detail">
|
286
|
+
<a name="formatter"></a>
|
287
|
+
|
288
|
+
<div class="method-heading attribute-method-heading">
|
289
|
+
<span class="method-name">formatter</span><span
|
290
|
+
class="attribute-access-type">[R]</span>
|
291
|
+
</div>
|
292
|
+
|
293
|
+
<div class="method-description">
|
294
|
+
|
295
|
+
<p class="missing-docs">(Not documented)</p>
|
296
|
+
|
297
|
+
</div>
|
298
|
+
</div>
|
299
|
+
|
300
|
+
</div>
|
301
|
+
|
302
|
+
|
303
|
+
<!-- Methods -->
|
304
|
+
|
305
|
+
<div id="public-class-method-details" class="method-section section">
|
306
|
+
<h3 class="section-header">Public Class Methods</h3>
|
307
|
+
|
308
|
+
|
309
|
+
<div id="--method" class="method-detail ">
|
310
|
+
<a name="M000115"></a>
|
311
|
+
|
312
|
+
<div class="method-heading">
|
313
|
+
|
314
|
+
<span class="method-name">[]</span><span
|
315
|
+
class="method-args">(name)</span>
|
316
|
+
<span class="method-click-advice">click to toggle source</span>
|
317
|
+
|
318
|
+
</div>
|
319
|
+
|
320
|
+
<div class="method-description">
|
321
|
+
|
322
|
+
<p>
|
323
|
+
Retrieve an outputter.
|
324
|
+
</p>
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
<div class="method-source-code"
|
329
|
+
id="--source">
|
330
|
+
<pre>
|
331
|
+
<span class="ruby-comment cmt"># File log4r/outputter/staticoutputter.rb, line 6</span>
|
332
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-operator">[]</span>(<span class="ruby-identifier">name</span>)
|
333
|
+
<span class="ruby-identifier">out</span> = <span class="ruby-ivar">@@outputters</span>[<span class="ruby-identifier">name</span>]
|
334
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">out</span>.<span class="ruby-identifier">nil?</span>
|
335
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">name</span>
|
336
|
+
<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>
|
337
|
+
<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>
|
338
|
+
<span class="ruby-keyword kw">else</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">end</span>
|
339
|
+
<span class="ruby-keyword kw">end</span>
|
340
|
+
<span class="ruby-identifier">out</span>
|
341
|
+
<span class="ruby-keyword kw">end</span></pre>
|
342
|
+
</div>
|
343
|
+
|
344
|
+
</div>
|
345
|
+
|
346
|
+
|
347
|
+
</div>
|
348
|
+
|
349
|
+
|
350
|
+
<div id="--method" class="method-detail ">
|
351
|
+
<a name="M000118"></a>
|
352
|
+
|
353
|
+
<div class="method-heading">
|
354
|
+
|
355
|
+
<span class="method-name">[]=</span><span
|
356
|
+
class="method-args">(name, outputter)</span>
|
357
|
+
<span class="method-click-advice">click to toggle source</span>
|
358
|
+
|
359
|
+
</div>
|
360
|
+
|
361
|
+
<div class="method-description">
|
362
|
+
|
363
|
+
<p>
|
364
|
+
Set an outputter.
|
365
|
+
</p>
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
<div class="method-source-code"
|
370
|
+
id="--source">
|
371
|
+
<pre>
|
372
|
+
<span class="ruby-comment cmt"># File log4r/outputter/staticoutputter.rb, line 19</span>
|
373
|
+
<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>)
|
374
|
+
<span class="ruby-ivar">@@outputters</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">outputter</span>
|
375
|
+
<span class="ruby-keyword kw">end</span></pre>
|
376
|
+
</div>
|
377
|
+
|
378
|
+
</div>
|
379
|
+
|
380
|
+
|
381
|
+
</div>
|
382
|
+
|
383
|
+
|
384
|
+
<div id="each-method" class="method-detail ">
|
385
|
+
<a name="M000121"></a>
|
386
|
+
|
387
|
+
<div class="method-heading">
|
388
|
+
|
389
|
+
<span class="method-name">each</span><span
|
390
|
+
class="method-args">()</span>
|
391
|
+
<span class="method-click-advice">click to toggle source</span>
|
392
|
+
|
393
|
+
</div>
|
394
|
+
|
395
|
+
<div class="method-description">
|
396
|
+
|
397
|
+
<p>
|
398
|
+
Yields each outputter’s name and reference.
|
399
|
+
</p>
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
<div class="method-source-code"
|
404
|
+
id="each-source">
|
405
|
+
<pre>
|
406
|
+
<span class="ruby-comment cmt"># File log4r/outputter/staticoutputter.rb, line 23</span>
|
407
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">each</span>
|
408
|
+
<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>}
|
409
|
+
<span class="ruby-keyword kw">end</span></pre>
|
410
|
+
</div>
|
411
|
+
|
412
|
+
</div>
|
413
|
+
|
414
|
+
|
415
|
+
</div>
|
416
|
+
|
417
|
+
|
418
|
+
<div id="each-outputter-method" class="method-detail ">
|
419
|
+
<a name="M000122"></a>
|
420
|
+
|
421
|
+
<div class="method-heading">
|
422
|
+
|
423
|
+
<span class="method-name">each_outputter</span><span
|
424
|
+
class="method-args">()</span>
|
425
|
+
<span class="method-click-advice">click to toggle source</span>
|
426
|
+
|
427
|
+
</div>
|
428
|
+
|
429
|
+
<div class="method-description">
|
430
|
+
|
431
|
+
<p class="missing-docs">(Not documented)</p>
|
432
|
+
|
433
|
+
|
434
|
+
|
435
|
+
<div class="method-source-code"
|
436
|
+
id="each-outputter-source">
|
437
|
+
<pre>
|
438
|
+
<span class="ruby-comment cmt"># File log4r/outputter/staticoutputter.rb, line 26</span>
|
439
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">each_outputter</span>
|
440
|
+
<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>}
|
441
|
+
<span class="ruby-keyword kw">end</span></pre>
|
442
|
+
</div>
|
443
|
+
|
444
|
+
</div>
|
445
|
+
|
446
|
+
|
447
|
+
</div>
|
448
|
+
|
449
|
+
|
450
|
+
<div id="new-method" class="method-detail ">
|
451
|
+
<a name="M000098"></a>
|
452
|
+
|
453
|
+
<div class="method-heading">
|
454
|
+
|
455
|
+
<span class="method-name">new</span><span
|
456
|
+
class="method-args">(_name, hash={})</span>
|
457
|
+
<span class="method-click-advice">click to toggle source</span>
|
458
|
+
|
459
|
+
</div>
|
460
|
+
|
461
|
+
<div class="method-description">
|
462
|
+
|
463
|
+
<p>
|
464
|
+
An <a href="Outputter.html">Outputter</a> needs a name. <a
|
465
|
+
href="RootLogger.html">RootLogger</a> will be loaded if not already done.
|
466
|
+
The hash arguments are as follows:
|
467
|
+
</p>
|
468
|
+
<dl>
|
469
|
+
<dt><tt>:level</tt></dt><dd><a href="Logger.html">Logger</a> level. Optional, defaults to root level
|
470
|
+
|
471
|
+
</dd>
|
472
|
+
<dt><tt>:formatter</tt></dt><dd>A <a href="Formatter.html">Formatter</a>. Defaults to <a
|
473
|
+
href="DefaultFormatter.html">DefaultFormatter</a>
|
474
|
+
|
475
|
+
</dd>
|
476
|
+
</dl>
|
477
|
+
|
478
|
+
|
479
|
+
|
480
|
+
<div class="method-source-code"
|
481
|
+
id="new-source">
|
482
|
+
<pre>
|
483
|
+
<span class="ruby-comment cmt"># File log4r/outputter/outputter.rb, line 26</span>
|
484
|
+
<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>={})
|
485
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">_name</span>.<span class="ruby-identifier">nil?</span>
|
486
|
+
<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>
|
487
|
+
<span class="ruby-keyword kw">end</span>
|
488
|
+
<span class="ruby-ivar">@name</span> = <span class="ruby-identifier">_name</span>
|
489
|
+
<span class="ruby-identifier">validate_hash</span>(<span class="ruby-identifier">hash</span>)
|
490
|
+
<span class="ruby-ivar">@@outputters</span>[<span class="ruby-ivar">@name</span>] = <span class="ruby-keyword kw">self</span>
|
491
|
+
<span class="ruby-keyword kw">end</span></pre>
|
492
|
+
</div>
|
493
|
+
|
494
|
+
</div>
|
495
|
+
|
496
|
+
|
497
|
+
</div>
|
498
|
+
|
499
|
+
|
500
|
+
<div id="stderr-method" class="method-detail ">
|
501
|
+
<a name="M000117"></a>
|
502
|
+
|
503
|
+
<div class="method-heading">
|
504
|
+
|
505
|
+
<span class="method-name">stderr</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="stderr-source">
|
519
|
+
<pre>
|
520
|
+
<span class="ruby-comment cmt"># File log4r/outputter/staticoutputter.rb, line 17</span>
|
521
|
+
<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>
|
522
|
+
</div>
|
523
|
+
|
524
|
+
</div>
|
525
|
+
|
526
|
+
|
527
|
+
</div>
|
528
|
+
|
529
|
+
|
530
|
+
<div id="stdout-method" class="method-detail ">
|
531
|
+
<a name="M000116"></a>
|
532
|
+
|
533
|
+
<div class="method-heading">
|
534
|
+
|
535
|
+
<span class="method-name">stdout</span><span
|
536
|
+
class="method-args">()</span>
|
537
|
+
<span class="method-click-advice">click to toggle source</span>
|
538
|
+
|
539
|
+
</div>
|
540
|
+
|
541
|
+
<div class="method-description">
|
542
|
+
|
543
|
+
<p class="missing-docs">(Not documented)</p>
|
544
|
+
|
545
|
+
|
546
|
+
|
547
|
+
<div class="method-source-code"
|
548
|
+
id="stdout-source">
|
549
|
+
<pre>
|
550
|
+
<span class="ruby-comment cmt"># File log4r/outputter/staticoutputter.rb, line 16</span>
|
551
|
+
<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>
|
552
|
+
</div>
|
553
|
+
|
554
|
+
</div>
|
555
|
+
|
556
|
+
|
557
|
+
</div>
|
558
|
+
|
559
|
+
|
560
|
+
</div>
|
561
|
+
|
562
|
+
<div id="public-instance-method-details" class="method-section section">
|
563
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
564
|
+
|
565
|
+
|
566
|
+
<div id="flush-method" class="method-detail ">
|
567
|
+
<a name="M000102"></a>
|
568
|
+
|
569
|
+
<div class="method-heading">
|
570
|
+
|
571
|
+
<span class="method-name">flush</span><span
|
572
|
+
class="method-args">()</span>
|
573
|
+
<span class="method-click-advice">click to toggle source</span>
|
574
|
+
|
575
|
+
</div>
|
576
|
+
|
577
|
+
<div class="method-description">
|
578
|
+
|
579
|
+
<p>
|
580
|
+
Call flush to force an outputter to write out any buffered log events.
|
581
|
+
Similar to IO#flush, so use in a similar fashion.
|
582
|
+
</p>
|
583
|
+
|
584
|
+
|
585
|
+
|
586
|
+
<div class="method-source-code"
|
587
|
+
id="flush-source">
|
588
|
+
<pre>
|
589
|
+
<span class="ruby-comment cmt"># File log4r/outputter/outputter.rb, line 78</span>
|
590
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">flush</span>
|
591
|
+
<span class="ruby-keyword kw">end</span></pre>
|
592
|
+
</div>
|
593
|
+
|
594
|
+
</div>
|
595
|
+
|
596
|
+
|
597
|
+
</div>
|
598
|
+
|
599
|
+
|
600
|
+
<div id="formatter--method" class="method-detail ">
|
601
|
+
<a name="M000101"></a>
|
602
|
+
|
603
|
+
<div class="method-heading">
|
604
|
+
|
605
|
+
<span class="method-name">formatter=</span><span
|
606
|
+
class="method-args">(_formatter)</span>
|
607
|
+
<span class="method-click-advice">click to toggle source</span>
|
608
|
+
|
609
|
+
</div>
|
610
|
+
|
611
|
+
<div class="method-description">
|
612
|
+
|
613
|
+
<p>
|
614
|
+
Dynamically change the formatter. You can just specify a Class object and
|
615
|
+
the formatter will invoke <tt>new</tt> or <tt>instance</tt> on it as
|
616
|
+
appropriate.
|
617
|
+
</p>
|
618
|
+
|
619
|
+
|
620
|
+
|
621
|
+
<div class="method-source-code"
|
622
|
+
id="formatter--source">
|
623
|
+
<pre>
|
624
|
+
<span class="ruby-comment cmt"># File log4r/outputter/outputter.rb, line 60</span>
|
625
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">formatter=</span>(<span class="ruby-identifier">_formatter</span>)
|
626
|
+
<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>)
|
627
|
+
<span class="ruby-ivar">@formatter</span> = <span class="ruby-identifier">_formatter</span>
|
628
|
+
<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>
|
629
|
+
<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>
|
630
|
+
<span class="ruby-ivar">@formatter</span> = <span class="ruby-identifier">_formatter</span>.<span class="ruby-identifier">instance</span>
|
631
|
+
<span class="ruby-keyword kw">else</span>
|
632
|
+
<span class="ruby-ivar">@formatter</span> = <span class="ruby-identifier">_formatter</span>.<span class="ruby-identifier">new</span>
|
633
|
+
<span class="ruby-keyword kw">end</span>
|
634
|
+
<span class="ruby-keyword kw">else</span>
|
635
|
+
<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>
|
636
|
+
<span class="ruby-keyword kw">end</span>
|
637
|
+
<span class="ruby-constant">Logger</span>.<span class="ruby-identifier">log_internal</span> {<span class="ruby-node">"Outputter '#{@name}' using #{@formatter.class}"</span>}
|
638
|
+
<span class="ruby-keyword kw">end</span></pre>
|
639
|
+
</div>
|
640
|
+
|
641
|
+
</div>
|
642
|
+
|
643
|
+
|
644
|
+
</div>
|
645
|
+
|
646
|
+
|
647
|
+
<div id="level--method" class="method-detail ">
|
648
|
+
<a name="M000099"></a>
|
649
|
+
|
650
|
+
<div class="method-heading">
|
651
|
+
|
652
|
+
<span class="method-name">level=</span><span
|
653
|
+
class="method-args">(_level)</span>
|
654
|
+
<span class="method-click-advice">click to toggle source</span>
|
655
|
+
|
656
|
+
</div>
|
657
|
+
|
658
|
+
<div class="method-description">
|
659
|
+
|
660
|
+
<p>
|
661
|
+
dynamically change the level
|
662
|
+
</p>
|
663
|
+
|
664
|
+
|
665
|
+
|
666
|
+
<div class="method-source-code"
|
667
|
+
id="level--source">
|
668
|
+
<pre>
|
669
|
+
<span class="ruby-comment cmt"># File log4r/outputter/outputter.rb, line 36</span>
|
670
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">level=</span>(<span class="ruby-identifier">_level</span>)
|
671
|
+
<span class="ruby-constant">Log4rTools</span>.<span class="ruby-identifier">validate_level</span>(<span class="ruby-identifier">_level</span>)
|
672
|
+
<span class="ruby-ivar">@level</span> = <span class="ruby-identifier">_level</span>
|
673
|
+
<span class="ruby-constant">OutputterFactory</span>.<span class="ruby-identifier">create_methods</span>(<span class="ruby-keyword kw">self</span>)
|
674
|
+
<span class="ruby-constant">Logger</span>.<span class="ruby-identifier">log_internal</span> {<span class="ruby-node">"Outputter '#{@name}' level is #{LNAMES[_level]}"</span>}
|
675
|
+
<span class="ruby-keyword kw">end</span></pre>
|
676
|
+
</div>
|
677
|
+
|
678
|
+
</div>
|
679
|
+
|
680
|
+
|
681
|
+
</div>
|
682
|
+
|
683
|
+
|
684
|
+
<div id="only-at-method" class="method-detail ">
|
685
|
+
<a name="M000100"></a>
|
686
|
+
|
687
|
+
<div class="method-heading">
|
688
|
+
|
689
|
+
<span class="method-name">only_at</span><span
|
690
|
+
class="method-args">(*levels)</span>
|
691
|
+
<span class="method-click-advice">click to toggle source</span>
|
692
|
+
|
693
|
+
</div>
|
694
|
+
|
695
|
+
<div class="method-description">
|
696
|
+
|
697
|
+
<p>
|
698
|
+
Set the levels to log. All others will be ignored
|
699
|
+
</p>
|
700
|
+
|
701
|
+
|
702
|
+
|
703
|
+
<div class="method-source-code"
|
704
|
+
id="only-at-source">
|
705
|
+
<pre>
|
706
|
+
<span class="ruby-comment cmt"># File log4r/outputter/outputter.rb, line 44</span>
|
707
|
+
<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>)
|
708
|
+
<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>
|
709
|
+
<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>
|
710
|
+
<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>)}
|
711
|
+
<span class="ruby-ivar">@level</span> = <span class="ruby-identifier">levels</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">first</span>
|
712
|
+
<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>
|
713
|
+
<span class="ruby-constant">Logger</span>.<span class="ruby-identifier">log_internal</span> {
|
714
|
+
<span class="ruby-node">"Outputter '#{@name}' writes only on "</span> <span class="ruby-operator">+</span>\
|
715
|
+
<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>)
|
716
|
+
}
|
717
|
+
<span class="ruby-keyword kw">end</span></pre>
|
718
|
+
</div>
|
719
|
+
|
720
|
+
</div>
|
721
|
+
|
722
|
+
|
723
|
+
</div>
|
724
|
+
|
725
|
+
|
726
|
+
<div id="validate-hash-method" class="method-detail ">
|
727
|
+
<a name="M000103"></a>
|
728
|
+
|
729
|
+
<div class="method-heading">
|
730
|
+
|
731
|
+
<span class="method-name">validate_hash</span><span
|
732
|
+
class="method-args">(hash)</span>
|
733
|
+
<span class="method-click-advice">click to toggle source</span>
|
734
|
+
|
735
|
+
</div>
|
736
|
+
|
737
|
+
<div class="method-description">
|
738
|
+
|
739
|
+
<p>
|
740
|
+
Validates the common hash arguments. For now, that would be
|
741
|
+
<tt>:level</tt>, <tt>:formatter</tt> and the string equivalents
|
742
|
+
</p>
|
743
|
+
|
744
|
+
|
745
|
+
|
746
|
+
<div class="method-source-code"
|
747
|
+
id="validate-hash-source">
|
748
|
+
<pre>
|
749
|
+
<span class="ruby-comment cmt"># File log4r/outputter/outputter.rb, line 87</span>
|
750
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_hash</span>(<span class="ruby-identifier">hash</span>)
|
751
|
+
<span class="ruby-ivar">@mutex</span> = <span class="ruby-constant">Mutex</span>.<span class="ruby-identifier">new</span>
|
752
|
+
<span class="ruby-comment cmt"># default to root level and DefaultFormatter</span>
|
753
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">empty?</span>
|
754
|
+
<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>
|
755
|
+
<span class="ruby-ivar">@formatter</span> = <span class="ruby-constant">DefaultFormatter</span>.<span class="ruby-identifier">new</span>
|
756
|
+
<span class="ruby-keyword kw">return</span>
|
757
|
+
<span class="ruby-keyword kw">end</span>
|
758
|
+
<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>)
|
759
|
+
<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>)
|
760
|
+
<span class="ruby-keyword kw">end</span></pre>
|
761
|
+
</div>
|
762
|
+
|
763
|
+
</div>
|
764
|
+
|
765
|
+
|
766
|
+
</div>
|
767
|
+
|
768
|
+
|
769
|
+
</div>
|
770
|
+
|
771
|
+
<div id="private-instance-method-details" class="method-section section">
|
772
|
+
<h3 class="section-header">Private Instance Methods</h3>
|
773
|
+
|
774
|
+
|
775
|
+
<div id="canonical-log-method" class="method-detail ">
|
776
|
+
<a name="M000104"></a>
|
777
|
+
|
778
|
+
<div class="method-heading">
|
779
|
+
|
780
|
+
<span class="method-name">canonical_log</span><span
|
781
|
+
class="method-args">(logevent)</span>
|
782
|
+
<span class="method-click-advice">click to toggle source</span>
|
783
|
+
|
784
|
+
</div>
|
785
|
+
|
786
|
+
<div class="method-description">
|
787
|
+
|
788
|
+
<p>
|
789
|
+
This method handles all log events passed to a typical <a
|
790
|
+
href="Outputter.html">Outputter</a>. Overload this to change the overall
|
791
|
+
behavior of an outputter. Make sure that the new behavior is thread safe.
|
792
|
+
</p>
|
793
|
+
|
794
|
+
|
795
|
+
|
796
|
+
<div class="method-source-code"
|
797
|
+
id="canonical-log-source">
|
798
|
+
<pre>
|
799
|
+
<span class="ruby-comment cmt"># File log4r/outputter/outputter.rb, line 107</span>
|
800
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">canonical_log</span>(<span class="ruby-identifier">logevent</span>)
|
801
|
+
<span class="ruby-identifier">synch</span> { <span class="ruby-identifier">write</span>(<span class="ruby-identifier">format</span>(<span class="ruby-identifier">logevent</span>)) }
|
802
|
+
<span class="ruby-keyword kw">end</span></pre>
|
803
|
+
</div>
|
804
|
+
|
805
|
+
</div>
|
806
|
+
|
807
|
+
|
808
|
+
</div>
|
809
|
+
|
810
|
+
|
811
|
+
<div id="format-method" class="method-detail ">
|
812
|
+
<a name="M000105"></a>
|
813
|
+
|
814
|
+
<div class="method-heading">
|
815
|
+
|
816
|
+
<span class="method-name">format</span><span
|
817
|
+
class="method-args">(logevent)</span>
|
818
|
+
<span class="method-click-advice">click to toggle source</span>
|
819
|
+
|
820
|
+
</div>
|
821
|
+
|
822
|
+
<div class="method-description">
|
823
|
+
|
824
|
+
<p>
|
825
|
+
Common method to format data. All it does is call the resident
|
826
|
+
formatter’s format method. If a different formatting behavior is
|
827
|
+
needed, then overload this method.
|
828
|
+
</p>
|
829
|
+
|
830
|
+
|
831
|
+
|
832
|
+
<div class="method-source-code"
|
833
|
+
id="format-source">
|
834
|
+
<pre>
|
835
|
+
<span class="ruby-comment cmt"># File log4r/outputter/outputter.rb, line 115</span>
|
836
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">format</span>(<span class="ruby-identifier">logevent</span>)
|
837
|
+
<span class="ruby-comment cmt"># @formatter is guaranteed to be DefaultFormatter if no Formatter</span>
|
838
|
+
<span class="ruby-comment cmt"># was specified</span>
|
839
|
+
<span class="ruby-ivar">@formatter</span>.<span class="ruby-identifier">format</span>(<span class="ruby-identifier">logevent</span>)
|
840
|
+
<span class="ruby-keyword kw">end</span></pre>
|
841
|
+
</div>
|
842
|
+
|
843
|
+
</div>
|
844
|
+
|
845
|
+
|
846
|
+
</div>
|
847
|
+
|
848
|
+
|
849
|
+
<div id="synch-method" class="method-detail ">
|
850
|
+
<a name="M000107"></a>
|
851
|
+
|
852
|
+
<div class="method-heading">
|
853
|
+
|
854
|
+
<span class="method-name">synch</span><span
|
855
|
+
class="method-args">()</span>
|
856
|
+
<span class="method-click-advice">click to toggle source</span>
|
857
|
+
|
858
|
+
</div>
|
859
|
+
|
860
|
+
<div class="method-description">
|
861
|
+
|
862
|
+
<p class="missing-docs">(Not documented)</p>
|
863
|
+
|
864
|
+
|
865
|
+
|
866
|
+
<div class="method-source-code"
|
867
|
+
id="synch-source">
|
868
|
+
<pre>
|
869
|
+
<span class="ruby-comment cmt"># File log4r/outputter/outputter.rb, line 128</span>
|
870
|
+
<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>
|
871
|
+
</div>
|
872
|
+
|
873
|
+
</div>
|
874
|
+
|
875
|
+
|
876
|
+
</div>
|
877
|
+
|
878
|
+
|
879
|
+
<div id="write-method" class="method-detail ">
|
880
|
+
<a name="M000106"></a>
|
881
|
+
|
882
|
+
<div class="method-heading">
|
883
|
+
|
884
|
+
<span class="method-name">write</span><span
|
885
|
+
class="method-args">(data)</span>
|
886
|
+
<span class="method-click-advice">click to toggle source</span>
|
887
|
+
|
888
|
+
</div>
|
889
|
+
|
890
|
+
<div class="method-description">
|
891
|
+
|
892
|
+
<p>
|
893
|
+
Abstract method to actually write the data to a destination. Custom
|
894
|
+
outputters should overload this to specify how the formatted data should be
|
895
|
+
written and to where.
|
896
|
+
</p>
|
897
|
+
|
898
|
+
|
899
|
+
|
900
|
+
<div class="method-source-code"
|
901
|
+
id="write-source">
|
902
|
+
<pre>
|
903
|
+
<span class="ruby-comment cmt"># File log4r/outputter/outputter.rb, line 125</span>
|
904
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write</span>(<span class="ruby-identifier">data</span>)
|
905
|
+
<span class="ruby-keyword kw">end</span></pre>
|
906
|
+
</div>
|
907
|
+
|
908
|
+
</div>
|
909
|
+
|
910
|
+
|
911
|
+
</div>
|
912
|
+
|
913
|
+
|
914
|
+
</div>
|
915
|
+
|
916
|
+
|
917
|
+
</div>
|
918
|
+
|
919
|
+
|
920
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
921
|
+
|
922
|
+
<p>Disabled; run with --debug to generate this.</p>
|
923
|
+
|
924
|
+
</div>
|
925
|
+
|
926
|
+
<div id="validator-badges">
|
927
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
928
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
929
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
930
|
+
</div>
|
931
|
+
|
932
|
+
</body>
|
933
|
+
</html>
|
934
|
+
|