File: classlog4cpp_1_1PatternLayout.html

package info (click to toggle)
log4cpp-doc 1.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,528 kB
  • sloc: makefile: 10
file content (286 lines) | stat: -rw-r--r-- 17,887 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>log4cpp: log4cpp::PatternLayout Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.2 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<div class="tabs">
  <ul>
    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul>
</div>
<div class="nav">
<a class="el" href="namespacelog4cpp.html">log4cpp</a>::<a class="el" href="classlog4cpp_1_1PatternLayout.html">PatternLayout</a></div>
<h1>log4cpp::PatternLayout Class Reference</h1><!-- doxytag: class="log4cpp::PatternLayout" --><!-- doxytag: inherits="log4cpp::Layout" --><a class="el" href="classlog4cpp_1_1PatternLayout.html" title="PatternLayout is a simple fixed format Layout implementation.">PatternLayout</a> is a simple fixed format <a class="el" href="classlog4cpp_1_1Layout.html" title="Extend this abstract class to create your own log layout format.">Layout</a> implementation.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="PatternLayout_8hh-source.html">PatternLayout.hh</a>&gt;</code>
<p>
Inheritance diagram for log4cpp::PatternLayout:<p><center><img src="classlog4cpp_1_1PatternLayout__inherit__graph.gif" border="0" usemap="#log4cpp_1_1PatternLayout__inherit__map" alt="Inheritance graph"></center>
<map name="log4cpp_1_1PatternLayout__inherit__map">
<area shape="rect" href="classlog4cpp_1_1Layout.html" title="Extend this abstract class to create your own log layout format." alt="" coords="24,5,133,32"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for log4cpp::PatternLayout:<p><center><img src="classlog4cpp_1_1PatternLayout__coll__graph.gif" border="0" usemap="#log4cpp_1_1PatternLayout__coll__map" alt="Collaboration graph"></center>
<map name="log4cpp_1_1PatternLayout__coll__map">
<area shape="rect" href="classlog4cpp_1_1Layout.html" title="Extend this abstract class to create your own log layout format." alt="" coords="24,5,133,32"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classlog4cpp_1_1PatternLayout-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout.html#4bca5fb678e85ce0d3fae128b10fc826">PatternLayout</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout.html#fa76336e2b107139407a1d6d41f22a82">~PatternLayout</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout.html#29c5e385c9f13fcfccdee71ef7a25354">format</a> (const <a class="el" href="structlog4cpp_1_1LoggingEvent.html">LoggingEvent</a> &amp;event)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Formats the <a class="el" href="structlog4cpp_1_1LoggingEvent.html" title="The internal representation of logging events.">LoggingEvent</a> in the style set by the setConversionPattern call.  <a href="#29c5e385c9f13fcfccdee71ef7a25354"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout.html#40116fcd7bee152b9ea624638c67deeb">setConversionPattern</a> (const std::string &amp;conversionPattern)  throw (ConfigureFailure)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the format of log lines handled by this <a class="el" href="classlog4cpp_1_1PatternLayout.html" title="PatternLayout is a simple fixed format Layout implementation.">PatternLayout</a>.  <a href="#40116fcd7bee152b9ea624638c67deeb"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout.html#05545f3679508383a8ed3c0f4c61ab73">getConversionPattern</a> () const</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout.html#5df26247f71992097d03999b4eddfb0c">clearConversionPattern</a> ()</td></tr>

<tr><td colspan="2"><br><h2>Static Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout.html#d79ee3afde403cd6c6e6ce433b675afb">DEFAULT_CONVERSION_PATTERN</a> = &quot;%m%n&quot;</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The default conversion pattern.  <a href="#d79ee3afde403cd6c6e6ce433b675afb"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout.html#eb2b239108ff547920ba43493346a190">SIMPLE_CONVERSION_PATTERN</a> = &quot;%p - %m%n&quot;</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A conversion pattern equivalent to the <a class="el" href="classlog4cpp_1_1SimpleLayout.html" title="BasicLayout is a simple fixed format Layout implementation.">SimpleLayout</a>.  <a href="#eb2b239108ff547920ba43493346a190"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout.html#f98de13eb4e2881975078fb869dd56e7">BASIC_CONVERSION_PATTERN</a> = &quot;%R %p %c %x: %m%n&quot;</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A conversion pattern equivalent to the <a class="el" href="classlog4cpp_1_1BasicLayout.html" title="BasicLayout is a simple fixed format Layout implementation.">BasicLayout</a>.  <a href="#f98de13eb4e2881975078fb869dd56e7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout.html#3ceed9dd11355695346f880a61cceac3">TTCC_CONVERSION_PATTERN</a> = &quot;%r [%t] %p %c %x - %m%n&quot;</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A conversion pattern equivalent to the TTCCLayout.  <a href="#3ceed9dd11355695346f880a61cceac3"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout_1_1PatternComponent.html">PatternComponent</a></td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<a class="el" href="classlog4cpp_1_1PatternLayout.html" title="PatternLayout is a simple fixed format Layout implementation.">PatternLayout</a> is a simple fixed format <a class="el" href="classlog4cpp_1_1Layout.html" title="Extend this abstract class to create your own log layout format.">Layout</a> implementation. 
<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="4bca5fb678e85ce0d3fae128b10fc826"></a><!-- doxytag: member="log4cpp::PatternLayout::PatternLayout" ref="4bca5fb678e85ce0d3fae128b10fc826" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">log4cpp::PatternLayout::PatternLayout           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

</div>
</div><p>
<a class="anchor" name="fa76336e2b107139407a1d6d41f22a82"></a><!-- doxytag: member="log4cpp::PatternLayout::~PatternLayout" ref="fa76336e2b107139407a1d6d41f22a82" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">log4cpp::PatternLayout::~PatternLayout           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="29c5e385c9f13fcfccdee71ef7a25354"></a><!-- doxytag: member="log4cpp::PatternLayout::format" ref="29c5e385c9f13fcfccdee71ef7a25354" args="(const LoggingEvent &amp;event)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string log4cpp::PatternLayout::format           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structlog4cpp_1_1LoggingEvent.html">LoggingEvent</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>event</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Formats the <a class="el" href="structlog4cpp_1_1LoggingEvent.html" title="The internal representation of logging events.">LoggingEvent</a> in the style set by the setConversionPattern call. 
<p>
By default, set to "%%m%%n" 
<p>
Implements <a class="el" href="classlog4cpp_1_1Layout.html#b52ceda3222f9102e41720b45ae3a939">log4cpp::Layout</a>.
</div>
</div><p>
<a class="anchor" name="40116fcd7bee152b9ea624638c67deeb"></a><!-- doxytag: member="log4cpp::PatternLayout::setConversionPattern" ref="40116fcd7bee152b9ea624638c67deeb" args="(const std::string &amp;conversionPattern)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void log4cpp::PatternLayout::setConversionPattern           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>conversionPattern</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%">  throw (<a class="el" href="classlog4cpp_1_1ConfigureFailure.html">ConfigureFailure</a>)<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sets the format of log lines handled by this <a class="el" href="classlog4cpp_1_1PatternLayout.html" title="PatternLayout is a simple fixed format Layout implementation.">PatternLayout</a>. 
<p>
By default, set to "%%m%%n".<br>
 Format characters are as follows:<br>
 <b>%%</b> - a single percent sign <b>%c</b> - the category <b>%d</b> - the date<br>
 Date format: The date format character may be followed by a date format specifier enclosed between braces. For example, %d{%H:%M:%S,%l} or %d{%d %m %Y %H:%M:%S,%l}. If no date format specifier is given then the following format is used: "Wed Jan 02 02:03:55 1980". The date format specifier admits the same syntax as the ANSI C function strftime, with 1 addition. The addition is the specifier %l for milliseconds, padded with zeros to make 3 digits. <b>%m</b> - the message <b>%n</b> - the platform specific line separator <b>%p</b> - the priority <b>%r</b> - milliseconds since this layout was created. <b>%R</b> - seconds since Jan 1, 1970 <b>%u</b> - clock ticks since process start <b>%x</b> - the <a class="el" href="classlog4cpp_1_1NDC.html" title="The NDC class implements nested diagnostic contexts as defined by Neil Harrison in...">NDC</a> <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>conversionPattern</em>&nbsp;</td><td>the conversion pattern </td></tr>
  </table>
</dl>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classlog4cpp_1_1ConfigureFailure.html" title="Exception class for configuration.">ConfigureFailure</a></em>&nbsp;</td><td>if the pattern is invalid </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="05545f3679508383a8ed3c0f4c61ab73"></a><!-- doxytag: member="log4cpp::PatternLayout::getConversionPattern" ref="05545f3679508383a8ed3c0f4c61ab73" args="() const" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string log4cpp::PatternLayout::getConversionPattern           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

</div>
</div><p>
<a class="anchor" name="5df26247f71992097d03999b4eddfb0c"></a><!-- doxytag: member="log4cpp::PatternLayout::clearConversionPattern" ref="5df26247f71992097d03999b4eddfb0c" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void log4cpp::PatternLayout::clearConversionPattern           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="d79ee3afde403cd6c6e6ce433b675afb"></a><!-- doxytag: member="log4cpp::PatternLayout::DEFAULT_CONVERSION_PATTERN" ref="d79ee3afde403cd6c6e6ce433b675afb" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char * <a class="el" href="classlog4cpp_1_1PatternLayout.html#d79ee3afde403cd6c6e6ce433b675afb">log4cpp::PatternLayout::DEFAULT_CONVERSION_PATTERN</a> = &quot;%m%n&quot;<code> [static]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
The default conversion pattern. 
<p>

</div>
</div><p>
<a class="anchor" name="eb2b239108ff547920ba43493346a190"></a><!-- doxytag: member="log4cpp::PatternLayout::SIMPLE_CONVERSION_PATTERN" ref="eb2b239108ff547920ba43493346a190" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char * <a class="el" href="classlog4cpp_1_1PatternLayout.html#eb2b239108ff547920ba43493346a190">log4cpp::PatternLayout::SIMPLE_CONVERSION_PATTERN</a> = &quot;%p - %m%n&quot;<code> [static]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
A conversion pattern equivalent to the <a class="el" href="classlog4cpp_1_1SimpleLayout.html" title="BasicLayout is a simple fixed format Layout implementation.">SimpleLayout</a>. 
<p>

</div>
</div><p>
<a class="anchor" name="f98de13eb4e2881975078fb869dd56e7"></a><!-- doxytag: member="log4cpp::PatternLayout::BASIC_CONVERSION_PATTERN" ref="f98de13eb4e2881975078fb869dd56e7" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char * <a class="el" href="classlog4cpp_1_1PatternLayout.html#f98de13eb4e2881975078fb869dd56e7">log4cpp::PatternLayout::BASIC_CONVERSION_PATTERN</a> = &quot;%R %p %c %x: %m%n&quot;<code> [static]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
A conversion pattern equivalent to the <a class="el" href="classlog4cpp_1_1BasicLayout.html" title="BasicLayout is a simple fixed format Layout implementation.">BasicLayout</a>. 
<p>

</div>
</div><p>
<a class="anchor" name="3ceed9dd11355695346f880a61cceac3"></a><!-- doxytag: member="log4cpp::PatternLayout::TTCC_CONVERSION_PATTERN" ref="3ceed9dd11355695346f880a61cceac3" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char * <a class="el" href="classlog4cpp_1_1PatternLayout.html#3ceed9dd11355695346f880a61cceac3">log4cpp::PatternLayout::TTCC_CONVERSION_PATTERN</a> = &quot;%r [%t] %p %c %x - %m%n&quot;<code> [static]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
A conversion pattern equivalent to the TTCCLayout. 
<p>
Note: TTCCLayout is in log4j but not <a class="el" href="namespacelog4cpp.html" title="The top level namespace for all 'Log for C++' types and classes.">log4cpp</a>. 
</div>
</div><p>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="PatternLayout_8hh-source.html">PatternLayout.hh</a><li><a class="el" href="PatternLayout_8cpp.html">PatternLayout.cpp</a></ul>
<hr size="1"><address style="text-align: right;"><small>Generated on Mon Sep 3 11:55:06 2007 for log4cpp by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.2 </small></address>
</body>
</html>