Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 5fc82cd2dfd40b1b8acca39dd2860281 > files > 197

log4cpp-1.0-4.fc12.i686.rpm

<!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::Filter Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</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>
    </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="navpath"><a class="el" href="namespacelog4cpp.html">log4cpp</a>::<a class="el" href="classlog4cpp_1_1Filter.html">Filter</a>
  </div>
</div>
<div class="contents">
<h1>log4cpp::Filter Class Reference</h1><!-- doxytag: class="log4cpp::Filter" -->Users should extend this class to implement customized logging event filtering.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="Filter_8hh_source.html">Filter.hh</a>&gt;</code>
<p>

<p>
<a href="classlog4cpp_1_1Filter-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 Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">enum &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1Filter.html#258358b931aa7cd8ea20911e0f9bfcba">Decision</a> { <a class="el" href="classlog4cpp_1_1Filter.html#258358b931aa7cd8ea20911e0f9bfcba4894d9100d79b5a02318499007b44f5b">DENY</a> =  -1, 
<a class="el" href="classlog4cpp_1_1Filter.html#258358b931aa7cd8ea20911e0f9bfcbae63c2f2959ca9e0dcae0f803bd933d66">NEUTRAL</a> =  0, 
<a class="el" href="classlog4cpp_1_1Filter.html#258358b931aa7cd8ea20911e0f9bfcbaaefa860fd668e3ec44eea46a39325de4">ACCEPT</a> =  1
 }</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_1Filter.html#ca1fe740d1439867b099d9e1a975718b">Filter</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default Constructor for <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a>.  <a href="#ca1fe740d1439867b099d9e1a975718b"></a><br></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_1Filter.html#d50c63830cf132630d593ab0cc1a99bd">~Filter</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor for <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a>.  <a href="#d50c63830cf132630d593ab0cc1a99bd"></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_1Filter.html#2f1d46477399905d164c395e5f255732">setChainedFilter</a> (<a class="el" href="classlog4cpp_1_1Filter.html">Filter</a> *filter)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the next <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> in the <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> chain.  <a href="#2f1d46477399905d164c395e5f255732"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="classlog4cpp_1_1Filter.html">Filter</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1Filter.html#598533f57055baa5f72d677d3fcd9bf9">getChainedFilter</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the next <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> in the <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> chain.  <a href="#598533f57055baa5f72d677d3fcd9bf9"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="classlog4cpp_1_1Filter.html">Filter</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1Filter.html#f1814369efb55989d3f72782a6d722b4">getEndOfChain</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the last <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> in the <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> chain.  <a href="#f1814369efb55989d3f72782a6d722b4"></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_1Filter.html#0085e38d65401acd22a5dddf639b4472">appendChainedFilter</a> (<a class="el" href="classlog4cpp_1_1Filter.html">Filter</a> *filter)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add a <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> to the end of the <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> chain.  <a href="#0085e38d65401acd22a5dddf639b4472"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="classlog4cpp_1_1Filter.html#258358b931aa7cd8ea20911e0f9bfcba">Decision</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1Filter.html#b61b417a36845ce326279eefdefaebc5">decide</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">Decide whether to accept or deny a <a class="el" href="structlog4cpp_1_1LoggingEvent.html" title="The internal representation of logging events.">LoggingEvent</a>.  <a href="#b61b417a36845ce326279eefdefaebc5"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="classlog4cpp_1_1Filter.html#258358b931aa7cd8ea20911e0f9bfcba">Decision</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1Filter.html#f23be38bc44ba21475df27a28bcffb4c">_decide</a> (const <a class="el" href="structlog4cpp_1_1LoggingEvent.html">LoggingEvent</a> &amp;event)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Decide whether <b>this</b> <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> accepts or denies the given <a class="el" href="structlog4cpp_1_1LoggingEvent.html" title="The internal representation of logging events.">LoggingEvent</a>.  <a href="#f23be38bc44ba21475df27a28bcffb4c"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Users should extend this class to implement customized logging event filtering. 
<p>
Note that <a class="el" href="classlog4cpp_1_1Category.html" title="This is the central class in the log4j package.">log4cpp::Category</a> and lof4cpp::Appender have built-in filtering rules. It is suggested that you first use and understand the built-in rules before rushing to write your own custom filters.<p>
This abstract class assumes and also imposes that filters be organized in a linear chain. The <code>decide(LoggingEvent)</code> method of each filter is called sequentially, in the order of their addition to the chain.<p>
The <code>decide(LoggingEvent)</code> method must return a Decision value, either DENY, NEUTRAL or ACCCEPT.<p>
If the value DENY is returned, then the log event is dropped immediately without consulting with the remaining filters.<p>
If the value NEUTRAL is returned, then the next filter in the chain is consulted. If there are no more filters in the chain, then the log event is logged. Thus, in the presence of no filters, the default behaviour is to log all logging events.<p>
If the value ACCEPT is returned, then the log event is logged without consulting the remaining filters.<p>
The philosophy of <a class="el" href="namespacelog4cpp.html" title="The top level namespace for all &#39;Log for C++&#39; types and classes.">log4cpp</a> filters is largely inspired from the Linux ipchains. <hr><h2>Member Enumeration Documentation</h2>
<a class="anchor" name="258358b931aa7cd8ea20911e0f9bfcba"></a><!-- doxytag: member="log4cpp::Filter::Decision" ref="258358b931aa7cd8ea20911e0f9bfcba" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classlog4cpp_1_1Filter.html#258358b931aa7cd8ea20911e0f9bfcba">log4cpp::Filter::Decision</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" name="258358b931aa7cd8ea20911e0f9bfcba4894d9100d79b5a02318499007b44f5b"></a><!-- doxytag: member="DENY" ref="258358b931aa7cd8ea20911e0f9bfcba4894d9100d79b5a02318499007b44f5b" args="" -->DENY</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="258358b931aa7cd8ea20911e0f9bfcbae63c2f2959ca9e0dcae0f803bd933d66"></a><!-- doxytag: member="NEUTRAL" ref="258358b931aa7cd8ea20911e0f9bfcbae63c2f2959ca9e0dcae0f803bd933d66" args="" -->NEUTRAL</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="258358b931aa7cd8ea20911e0f9bfcbaaefa860fd668e3ec44eea46a39325de4"></a><!-- doxytag: member="ACCEPT" ref="258358b931aa7cd8ea20911e0f9bfcbaaefa860fd668e3ec44eea46a39325de4" args="" -->ACCEPT</em>&nbsp;</td><td>
</td></tr>
</table>
</dl>

</div>
</div><p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="ca1fe740d1439867b099d9e1a975718b"></a><!-- doxytag: member="log4cpp::Filter::Filter" ref="ca1fe740d1439867b099d9e1a975718b" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">log4cpp::Filter::Filter           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Default Constructor for <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a>. 
<p>

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

<p>
Destructor for <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a>. 
<p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="f23be38bc44ba21475df27a28bcffb4c"></a><!-- doxytag: member="log4cpp::Filter::_decide" ref="f23be38bc44ba21475df27a28bcffb4c" args="(const LoggingEvent &amp;event)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classlog4cpp_1_1Filter.html#258358b931aa7cd8ea20911e0f9bfcba">Decision</a> log4cpp::Filter::_decide           </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><code> [protected, pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Decide whether <b>this</b> <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> accepts or denies the given <a class="el" href="structlog4cpp_1_1LoggingEvent.html" title="The internal representation of logging events.">LoggingEvent</a>. 
<p>
Actual implementation of <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> should override this method and not <code>decide(LoggingEvent&amp;)</code>. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>event</em>&nbsp;</td><td>The <a class="el" href="structlog4cpp_1_1LoggingEvent.html" title="The internal representation of logging events.">LoggingEvent</a> to decide on. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The Decision </dd></dl>

</div>
</div><p>
<a class="anchor" name="0085e38d65401acd22a5dddf639b4472"></a><!-- doxytag: member="log4cpp::Filter::appendChainedFilter" ref="0085e38d65401acd22a5dddf639b4472" args="(Filter *filter)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void log4cpp::Filter::appendChainedFilter           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classlog4cpp_1_1Filter.html">Filter</a> *&nbsp;</td>
          <td class="paramname"> <em>filter</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Add a <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> to the end of the <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> chain. 
<p>
Convience method for <a class="el" href="classlog4cpp_1_1Filter.html#f1814369efb55989d3f72782a6d722b4" title="Get the last Filter in the Filter chain.">getEndOfChain()</a>-&gt;setChainedFilter(filter). <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>filter</em>&nbsp;</td><td>The filter to add to the end of the chain. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="b61b417a36845ce326279eefdefaebc5"></a><!-- doxytag: member="log4cpp::Filter::decide" ref="b61b417a36845ce326279eefdefaebc5" args="(const LoggingEvent &amp;event)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classlog4cpp_1_1Filter.html#258358b931aa7cd8ea20911e0f9bfcba">Filter::Decision</a> log4cpp::Filter::decide           </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><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Decide whether to accept or deny a <a class="el" href="structlog4cpp_1_1LoggingEvent.html" title="The internal representation of logging events.">LoggingEvent</a>. 
<p>
This method will walk the entire chain until a non neutral decision has been made or the end of the chain has been reached. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>event</em>&nbsp;</td><td>The <a class="el" href="structlog4cpp_1_1LoggingEvent.html" title="The internal representation of logging events.">LoggingEvent</a> to decide on. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The Decision </dd></dl>

</div>
</div><p>
<a class="anchor" name="598533f57055baa5f72d677d3fcd9bf9"></a><!-- doxytag: member="log4cpp::Filter::getChainedFilter" ref="598533f57055baa5f72d677d3fcd9bf9" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classlog4cpp_1_1Filter.html">Filter</a> * log4cpp::Filter::getChainedFilter           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get the next <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> in the <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> chain. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The next <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> or NULL if the current filter is the last in the chain </dd></dl>

</div>
</div><p>
<a class="anchor" name="f1814369efb55989d3f72782a6d722b4"></a><!-- doxytag: member="log4cpp::Filter::getEndOfChain" ref="f1814369efb55989d3f72782a6d722b4" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classlog4cpp_1_1Filter.html">Filter</a> * log4cpp::Filter::getEndOfChain           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get the last <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> in the <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> chain. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The last <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> in the <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> chain </dd></dl>

</div>
</div><p>
<a class="anchor" name="2f1d46477399905d164c395e5f255732"></a><!-- doxytag: member="log4cpp::Filter::setChainedFilter" ref="2f1d46477399905d164c395e5f255732" args="(Filter *filter)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void log4cpp::Filter::setChainedFilter           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classlog4cpp_1_1Filter.html">Filter</a> *&nbsp;</td>
          <td class="paramname"> <em>filter</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set the next <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> in the <a class="el" href="classlog4cpp_1_1Filter.html" title="Users should extend this class to implement customized logging event filtering.">Filter</a> chain. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>filter</em>&nbsp;</td><td>The filter to chain </td></tr>
  </table>
</dl>

</div>
</div><p>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="Filter_8hh_source.html">Filter.hh</a><li><a class="el" href="Filter_8cpp.html">Filter.cpp</a></ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Jul 26 19:34:50 2009 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.9 </small></address>
</body>
</html>