You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-dev@logging.apache.org by ma...@apache.org on 2004/03/08 22:22:05 UTC

cvs commit: logging-log4php/src/tests/filters test.php

marco       2004/03/08 13:22:05

  Added:       src/tests/filters/configs LoggerDenyAllFilter.xml
                        LoggerLevelMatchFilter.xml
                        LoggerLevelRangeFilter.xml
                        LoggerStringMatchFilter.xml
               src/tests/filters test.php
  Log:
  Initial Import
  
  Revision  Changes    Path
  1.1                  logging-log4php/src/tests/filters/configs/LoggerDenyAllFilter.xml
  
  Index: LoggerDenyAllFilter.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <!--
      Copyright 2004 The Apache Software Foundation.
  
      This software is published under the terms of the Apache Software
      License version 2.0, a copy of which has been included with this
      distribution in the LICENSE file.
   
      @author Marco V. <ma...@apache.org>
      @version $Revision: 1.1 $
      @since 0.3
  -->
  <log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/" threshold="all" debug="true">
      <appender name="default" class="LoggerAppenderEcho">
          <layout class="LoggerLayoutHtml">
              <param name="locationInfo" value="true" />
              <param name="title" value="LoggerAppenderEcho Test" />
          </layout>
          <filter class="LoggerDenyAllFilter" />
      </appender>
  
      <root>
          <level value="debug" />
          <appender_ref ref="default" />        
      </root>
  </log4php:configuration>
  
  
  
  1.1                  logging-log4php/src/tests/filters/configs/LoggerLevelMatchFilter.xml
  
  Index: LoggerLevelMatchFilter.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <!--
      Copyright 2004 The Apache Software Foundation.
  
      This software is published under the terms of the Apache Software
      License version 2.0, a copy of which has been included with this
      distribution in the LICENSE file.
   
      @author Marco V. <ma...@apache.org>
      @version $Revision: 1.1 $
      @since 0.6
  -->
  <log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/" threshold="all" debug="false">
      <appender name="default" class="LoggerAppenderEcho">
          <layout class="LoggerLayoutHtml">
              <param name="locationInfo" value="true" />
              <param name="title" value="LoggerAppenderEcho Test" />
          </layout>
          <filter class="LoggerLevelMatchFilter">
              <param name="levelToMatch" value="DEBUG" />
              <param name="acceptOnMatch" value="false" />
          </filter>
      </appender>
      
      <root>
          <level value="all" />
          <appender_ref ref="default" />        
      </root>
  </log4php:configuration>
  
  
  
  1.1                  logging-log4php/src/tests/filters/configs/LoggerLevelRangeFilter.xml
  
  Index: LoggerLevelRangeFilter.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <!--
      Copyright 2004 The Apache Software Foundation.
  
      This software is published under the terms of the Apache Software
      License version 2.0, a copy of which has been included with this
      distribution in the LICENSE file.
   
      @author Marco V. <ma...@apache.org>
      @version $Revision: 1.1 $
      @since 0.6
  -->
  <log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/" threshold="all" debug="false">
      <appender name="default" class="LoggerAppenderEcho">
          <layout class="LoggerLayoutHtml">
              <param name="locationInfo" value="true" />
              <param name="title" value="LoggerAppenderEcho Test" />
          </layout>
          <filter class="LoggerLevelRangeFilter">
              <param name="levelMin" value="WARN" />
              <param name="levelMax" value="ERROR" />
              <param name="acceptOnMatch" value="true" />
          </filter>
      </appender>
      
      <root>
          <level value="all" />
          <appender_ref ref="default" />        
      </root>
  </log4php:configuration>
  
  
  
  1.1                  logging-log4php/src/tests/filters/configs/LoggerStringMatchFilter.xml
  
  Index: LoggerStringMatchFilter.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <!--
      Copyright 2004 The Apache Software Foundation.
  
      This software is published under the terms of the Apache Software
      License version 2.0, a copy of which has been included with this
      distribution in the LICENSE file.
   
      @author Marco V. <ma...@apache.org>
      @version $Revision: 1.1 $
      @since 0.3
  -->
  <log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/" threshold="all" debug="false">
      <appender name="default" class="LoggerAppenderEcho">
          <layout class="LoggerLayoutHtml">
              <param name="locationInfo" value="true" />
              <param name="title" value="LoggerAppenderEcho Test" />
          </layout>
          <filter class="LoggerStringMatchFilter">
              <param name="stringToMatch" value="test" />
              <param name="acceptOnMatch" value="false" />
          </filter>
      </appender>
      
      <root>
          <level value="debug" />
          <appender_ref ref="default" />        
      </root>
  </log4php:configuration>
  
  
  
  1.1                  logging-log4php/src/tests/filters/test.php
  
  Index: test.php
  ===================================================================
  <?php
  /**
   * Copyright 2004 The Apache Software Foundation.
   *
   * This software is published under the terms of the Apache Software
   * License version 2.0, a copy of which has been included with this
   * distribution in the LICENSE file.
   * 
   * @package tests
   * @author Marco V. <ma...@apache.org>
   * @subpackage filters
   * @version $Revision: 1.1 $
   * @since 0.3
   */
  
  /**
   * @var array Test array
   */
  $tests = array(
      'LoggerDenyAllFilter'       => array( 
          '__COMMENT__'  => 'Block all.'
      ),
      'LoggerStringMatchFilter'   => array( 
          '__COMMENT__'  => 'discard events with the string "test" in message.'
      ),
      'LoggerLevelMatchFilter'   => array( 
          '__COMMENT__'  => 'discard events with "DEBUG" level.'
      ),
      'LoggerLevelRangeFilter'   => array( 
          '__COMMENT__'  => 'report only "WARN" and "ERROR" events.'
      ),
  );
  
  require_once('../test_core.php');
  
  ?>