blob: 01163e45cf73f374caacea99ac7da00daddcb617 [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: LevelMatchFilter 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_match_filter.html">LevelMatchFilter</a></div>
<h1>LevelMatchFilter Class Reference</h1><!-- doxytag: class="log4cxx::filter::LevelMatchFilter" --><!-- 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_match_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.
<p>
The filter admits two options <b>LevelToMatch</b> and <b>AcceptOnMatch</b>. If there is an exact match between the value of the <b>LevelToMatch</b> option and the level of the <a class="el" href="classlog4cxx_1_1spi_1_1_logging_event.html">LoggingEvent</a>, then the <a class="el" href="classlog4cxx_1_1filter_1_1_level_match_filter.html#f0945cde84b8648b7497a6140e91ac5c">decide</a> method returns <a class="el" href="classlog4cxx_1_1spi_1_1_filter.html#8c8b0cee5b13b164894f9eedd8d78bcd5707b7b8bf1b098d620552e9576d8061">ACCEPT</a> in case the <b>AcceptOnMatch</b> option value is set to <code>true</code>, if it is <code>false</code> then <a class="el" href="classlog4cxx_1_1spi_1_1_filter.html#8c8b0cee5b13b164894f9eedd8d78bcd692e4d49cf7d68c58e78875ae1833fc3">DENY</a> is returned. If there is no match, <a class="el" href="classlog4cxx_1_1spi_1_1_filter.html#8c8b0cee5b13b164894f9eedd8d78bcdf46d14eb9d5d71afc9f6e747689fcb56">NEUTRAL</a> is returned.
<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_match_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_match_filter.html#d912f8b1b4da58312797f85e83d5da52">LevelMatchFilter</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_match_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_match_filter.html#5d39c1e21d99f6c0f6bfc56133cd95d6">setLevelToMatch</a> (const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;levelToMatch)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1filter_1_1_level_match_filter.html#510c61a4cbe9ebd181412318bea567d2">getLevelToMatch</a> () const </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_match_filter.html#8eefe1b300288451e6c0d570745eb7c3">setAcceptOnMatch</a> (bool acceptOnMatch1)</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_match_filter.html#1570b78d22e1bc9fd62145ed47b1b9d7">getAcceptOnMatch</a> () const </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_match_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::LevelMatchFilter::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="d912f8b1b4da58312797f85e83d5da52"></a><!-- doxytag: member="log4cxx::filter::LevelMatchFilter::LevelMatchFilter" ref="d912f8b1b4da58312797f85e83d5da52" 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_match_filter.html">LevelMatchFilter</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::LevelMatchFilter::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::LevelMatchFilter::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>
</td>
</tr>
</table>
<a class="anchor" name="510c61a4cbe9ebd181412318bea567d2"></a><!-- doxytag: member="log4cxx::filter::LevelMatchFilter::getLevelToMatch" ref="510c61a4cbe9ebd181412318bea567d2" 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"><a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> getLevelToMatch </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</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
</td>
</tr>
</table>
<a class="anchor" name="8eefe1b300288451e6c0d570745eb7c3"></a><!-- doxytag: member="log4cxx::filter::LevelMatchFilter::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>
</td>
</tr>
</table>
<a class="anchor" name="5d39c1e21d99f6c0f6bfc56133cd95d6"></a><!-- doxytag: member="log4cxx::filter::LevelMatchFilter::setLevelToMatch" ref="5d39c1e21d99f6c0f6bfc56133cd95d6" args="(const LogString &amp;levelToMatch)" --><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 setLevelToMatch </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="mdname1" valign="top" nowrap> <em>levelToMatch</em> </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>
<a class="anchor" name="ee5023c29cca9dc68164b22a01cb7c6e"></a><!-- doxytag: member="log4cxx::filter::LevelMatchFilter::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="levelmatchfilter_8h.html">levelmatchfilter.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>