blob: 6a88e7ce70996e5ef63bed39598bd7b378bcdc34 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Apache log4cxx: LevelRangeFilter 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.4.6 -->
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li id="current"><a href="classes.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="classes.html"><span>Alphabetical&nbsp;List</span></a></li>
<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="namespacelog4cxx.html">log4cxx</a>::<a class="el" href="namespacelog4cxx_1_1filter.html">filter</a>::<a class="el" href="classlog4cxx_1_1filter_1_1_level_range_filter.html">LevelRangeFilter</a></div>
<h1>LevelRangeFilter Class Reference</h1><!-- doxytag: class="log4cxx::filter::LevelRangeFilter" --><!-- doxytag: inherits="log4cxx::spi::Filter" -->Inherits <a class="el" href="classlog4cxx_1_1spi_1_1_filter.html">Filter</a>.
<p>
<a href="classlog4cxx_1_1filter_1_1_level_range_filter-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
This is a very simple filter based on level matching, which can be used to reject messages with priorities outside a certain range.
<p>
The filter admits three options <b>LevelMin</b>, <b>LevelMax</b> and <b>AcceptOnMatch</b>.<p>
If the level of the <a class="el" href="classlog4cxx_1_1spi_1_1_logging_event.html">LoggingEvent</a> is not between Min and Max (inclusive), then <a class="el" href="classlog4cxx_1_1spi_1_1_filter.html#8c8b0cee5b13b164894f9eedd8d78bcd692e4d49cf7d68c58e78875ae1833fc3">DENY</a> is returned.<p>
If the Logging event level is within the specified range, then if <b>AcceptOnMatch</b> is true, <a class="el" href="classlog4cxx_1_1spi_1_1_filter.html#8c8b0cee5b13b164894f9eedd8d78bcd5707b7b8bf1b098d620552e9576d8061">ACCEPT</a> is returned, and if <b>AcceptOnMatch</b> is false, <a class="el" href="classlog4cxx_1_1spi_1_1_filter.html#8c8b0cee5b13b164894f9eedd8d78bcdf46d14eb9d5d71afc9f6e747689fcb56">NEUTRAL</a> is returned.<p>
If <code>LevelMin</code>w is not defined, then there is no minimum acceptable level (ie a level is never rejected for being too "low"/unimportant). If <code>LevelMax</code> is not defined, then there is no maximum acceptable level (ie a level is never rejected for beeing too "high"/important).<p>
Refer to the <a class="el" href="classlog4cxx_1_1_appender_skeleton.html#09e9d86bbb2b7b2f94b3f7e74d3557a4">setThreshold</a> method available to <code>all</code> appenders extending <a class="el" href="classlog4cxx_1_1_appender_skeleton.html">AppenderSkeleton</a> for a more convenient way to filter out events by level.
<p>
<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">typedef <a class="el" href="classlog4cxx_1_1spi_1_1_filter.html">spi::Filter</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1filter_1_1_level_range_filter.html#183a00dc056dcc8be3cf0627730b54ca">BASE_CLASS</a></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="classlog4cxx_1_1filter_1_1_level_range_filter.html#de45fa3bc7a851ed66dfc1129c6c2438">LevelRangeFilter</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1filter_1_1_level_range_filter.html#ee5023c29cca9dc68164b22a01cb7c6e">setOption</a> (const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;option, const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;value)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set options. <a href="#ee5023c29cca9dc68164b22a01cb7c6e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1filter_1_1_level_range_filter.html#2ef28e48e3e68026a391b757d196b548">setLevelMin</a> (const <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">LevelPtr</a> &amp;levelMin1)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the <code>LevelMin</code> option. <a href="#2ef28e48e3e68026a391b757d196b548"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">LevelPtr</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1filter_1_1_level_range_filter.html#45c1d8e6cd0ec50cf08add40af6b4162">getLevelMin</a> () const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the value of the <code>LevelMin</code> option. <a href="#45c1d8e6cd0ec50cf08add40af6b4162"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1filter_1_1_level_range_filter.html#332fce23df18c3deaa03050afd92492b">setLevelMax</a> (const <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">LevelPtr</a> &amp;levelMax1)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the <code>LevelMax</code> option. <a href="#332fce23df18c3deaa03050afd92492b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">LevelPtr</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1filter_1_1_level_range_filter.html#f91ff8f0e42f5c75341b2a8028e990c8">getLevelMax</a> () const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the value of the <code>LevelMax</code> option. <a href="#f91ff8f0e42f5c75341b2a8028e990c8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1filter_1_1_level_range_filter.html#8eefe1b300288451e6c0d570745eb7c3">setAcceptOnMatch</a> (bool acceptOnMatch1)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the <code>AcceptOnMatch</code> option. <a href="#8eefe1b300288451e6c0d570745eb7c3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1filter_1_1_level_range_filter.html#1570b78d22e1bc9fd62145ed47b1b9d7">getAcceptOnMatch</a> () const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the value of the <code>AcceptOnMatch</code> option. <a href="#1570b78d22e1bc9fd62145ed47b1b9d7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classlog4cxx_1_1spi_1_1_filter.html#8c8b0cee5b13b164894f9eedd8d78bcd">FilterDecision</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1filter_1_1_level_range_filter.html#f0945cde84b8648b7497a6140e91ac5c">decide</a> (const <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">spi::LoggingEventPtr</a> &amp;event) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the decision of this filter. <a href="#f0945cde84b8648b7497a6140e91ac5c"></a><br></td></tr>
</table>
<hr><h2>Member Typedef Documentation</h2>
<a class="anchor" name="183a00dc056dcc8be3cf0627730b54ca"></a><!-- doxytag: member="log4cxx::filter::LevelRangeFilter::BASE_CLASS" ref="183a00dc056dcc8be3cf0627730b54ca" args="" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">typedef <a class="el" href="classlog4cxx_1_1spi_1_1_filter.html">spi::Filter</a> <a class="el" href="classlog4cxx_1_1spi_1_1_filter.html">BASE_CLASS</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
</td>
</tr>
</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="de45fa3bc7a851ed66dfc1129c6c2438"></a><!-- doxytag: member="log4cxx::filter::LevelRangeFilter::LevelRangeFilter" ref="de45fa3bc7a851ed66dfc1129c6c2438" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="classlog4cxx_1_1filter_1_1_level_range_filter.html">LevelRangeFilter</a> </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
</td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="f0945cde84b8648b7497a6140e91ac5c"></a><!-- doxytag: member="log4cxx::filter::LevelRangeFilter::decide" ref="f0945cde84b8648b7497a6140e91ac5c" args="(const spi::LoggingEventPtr &amp;event) const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="classlog4cxx_1_1spi_1_1_filter.html#8c8b0cee5b13b164894f9eedd8d78bcd">FilterDecision</a> decide </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">spi::LoggingEventPtr</a> &amp;&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>event</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap> const<code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Return the decision of this filter.
<p>
Returns <a class="el" href="classlog4cxx_1_1spi_1_1_filter.html#8c8b0cee5b13b164894f9eedd8d78bcdf46d14eb9d5d71afc9f6e747689fcb56">NEUTRAL</a> if the <b>LevelToMatch</b> option is not set or if there is not match. Otherwise, if there is a match, then the returned decision is <a class="el" href="classlog4cxx_1_1spi_1_1_filter.html#8c8b0cee5b13b164894f9eedd8d78bcd5707b7b8bf1b098d620552e9576d8061">ACCEPT</a> if the <b>AcceptOnMatch</b> property is set to <code>true</code>. The returned decision is <a class="el" href="classlog4cxx_1_1spi_1_1_filter.html#8c8b0cee5b13b164894f9eedd8d78bcd692e4d49cf7d68c58e78875ae1833fc3">DENY</a> if the <b>AcceptOnMatch</b> property is set to false.
<p>
Implements <a class="el" href="classlog4cxx_1_1spi_1_1_filter.html#88283dec47599dde698374489126f01c">Filter</a>. </td>
</tr>
</table>
<a class="anchor" name="1570b78d22e1bc9fd62145ed47b1b9d7"></a><!-- doxytag: member="log4cxx::filter::LevelRangeFilter::getAcceptOnMatch" ref="1570b78d22e1bc9fd62145ed47b1b9d7" args="() const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">bool getAcceptOnMatch </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap> const<code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Get the value of the <code>AcceptOnMatch</code> option.
<p>
</td>
</tr>
</table>
<a class="anchor" name="f91ff8f0e42f5c75341b2a8028e990c8"></a><!-- doxytag: member="log4cxx::filter::LevelRangeFilter::getLevelMax" ref="f91ff8f0e42f5c75341b2a8028e990c8" args="() const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">const <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">LevelPtr</a>&amp; getLevelMax </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap> const<code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Get the value of the <code>LevelMax</code> option.
<p>
</td>
</tr>
</table>
<a class="anchor" name="45c1d8e6cd0ec50cf08add40af6b4162"></a><!-- doxytag: member="log4cxx::filter::LevelRangeFilter::getLevelMin" ref="45c1d8e6cd0ec50cf08add40af6b4162" args="() const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">const <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">LevelPtr</a>&amp; getLevelMin </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap> const<code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Get the value of the <code>LevelMin</code> option.
<p>
</td>
</tr>
</table>
<a class="anchor" name="8eefe1b300288451e6c0d570745eb7c3"></a><!-- doxytag: member="log4cxx::filter::LevelRangeFilter::setAcceptOnMatch" ref="8eefe1b300288451e6c0d570745eb7c3" args="(bool acceptOnMatch1)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void setAcceptOnMatch </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">bool&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>acceptOnMatch1</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Set the <code>AcceptOnMatch</code> option.
<p>
</td>
</tr>
</table>
<a class="anchor" name="332fce23df18c3deaa03050afd92492b"></a><!-- doxytag: member="log4cxx::filter::LevelRangeFilter::setLevelMax" ref="332fce23df18c3deaa03050afd92492b" args="(const LevelPtr &amp;levelMax1)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void setLevelMax </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">LevelPtr</a> &amp;&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>levelMax1</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Set the <code>LevelMax</code> option.
<p>
</td>
</tr>
</table>
<a class="anchor" name="2ef28e48e3e68026a391b757d196b548"></a><!-- doxytag: member="log4cxx::filter::LevelRangeFilter::setLevelMin" ref="2ef28e48e3e68026a391b757d196b548" args="(const LevelPtr &amp;levelMin1)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void setLevelMin </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">LevelPtr</a> &amp;&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>levelMin1</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Set the <code>LevelMin</code> option.
<p>
</td>
</tr>
</table>
<a class="anchor" name="ee5023c29cca9dc68164b22a01cb7c6e"></a><!-- doxytag: member="log4cxx::filter::LevelRangeFilter::setOption" ref="ee5023c29cca9dc68164b22a01cb7c6e" args="(const LogString &amp;option, const LogString &amp;value)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual void setOption </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>option</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>value</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Set options.
<p>
<p>
Reimplemented from <a class="el" href="classlog4cxx_1_1spi_1_1_filter.html#c1d269357907e0809687a2bec962e1c8">Filter</a>. </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="levelrangefilter_8h.html">levelrangefilter.h</a></ul>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
</BODY>
</HTML>