当前位置: 首页>>代码示例>>PHP>>正文


PHP SS_Log::remove_writer方法代码示例

本文整理汇总了PHP中SS_Log::remove_writer方法的典型用法代码示例。如果您正苦于以下问题:PHP SS_Log::remove_writer方法的具体用法?PHP SS_Log::remove_writer怎么用?PHP SS_Log::remove_writer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SS_Log的用法示例。


在下文中一共展示了SS_Log::remove_writer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testLogsError

 public function testLogsError()
 {
     $logger = new TestWorkableLogger();
     SS_Log::add_writer($logger);
     $result = Workable::create()->getJobs(['state' => 'fail']);
     $this->assertNotNull($logger->event);
     SS_Log::remove_writer($logger);
 }
开发者ID:silverstripe-labs,项目名称:workable,代码行数:8,代码来源:WorkableTest.php

示例2: testRemoveWriter

 function testRemoveWriter()
 {
     SS_Log::remove_writer($this->testEmailWriter);
     $writers = SS_Log::get_writers();
     $this->assertType('array', $writers);
     $this->assertEquals(1, count($writers));
     SS_Log::remove_writer($this->testFileWriter);
     $writers = SS_Log::get_writers();
     $this->assertType('array', $writers);
     $this->assertEquals(0, count($writers));
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:11,代码来源:LogTest.php

示例3: testRemoveWriter

 public function testRemoveWriter()
 {
     $testEmailWriter = new SS_LogEmailWriter('test@test.com');
     $testFileWriter = new SS_LogFileWriter('../test.log');
     SS_Log::add_writer($testEmailWriter, SS_Log::ERR);
     SS_Log::add_writer($testFileWriter, SS_Log::WARN);
     SS_Log::remove_writer($testEmailWriter);
     $writers = SS_Log::get_writers();
     $this->assertEquals(1, count($writers));
     SS_Log::remove_writer($testFileWriter);
     $writers = SS_Log::get_writers();
     $this->assertEquals(0, count($writers));
 }
开发者ID:jakedaleweb,项目名称:AtomCodeChallenge,代码行数:13,代码来源:LogTest.php

示例4: log_error_if_necessary

 /**
  * Log the given error, if self::$log_errors is set.
  * Uses the native error_log() funtion in PHP.
  * 
  * Format: [d-M-Y h:i:s] <type> at <file> line <line>: <errormessage> <url>
  * 
  * @todo Detect script path for CLI errors
  * @todo Log detailed errors to full file
  * @deprecated 2.5 See SS_Log on setting up error file logging
  */
 protected static function log_error_if_necessary($errno, $errstr, $errfile, $errline, $errcontext, $errtype)
 {
     Deprecation::notice('2.5', 'Use SS_Log instead. See the class documentation in SS_Log.php for more information.');
     $priority = $errtype == 'Error' ? SS_Log::ERR : SS_Log::WARN;
     $writer = new SS_LogFileWriter('../' . self::$log_errors_to);
     SS_Log::add_writer($writer, $priority);
     SS_Log::log(array('errno' => $errno, 'errstr' => $errstr, 'errfile' => $errfile, 'errline' => $errline, 'errcontext' => $errcontext), $priority);
     SS_Log::remove_writer($writer);
 }
开发者ID:nomidi,项目名称:sapphire,代码行数:19,代码来源:Debug.php

示例5: log_error_if_necessary

    /**
     * Log the given error, if self::$log_errors is set.
     * Uses the native error_log() funtion in PHP.
     * 
     * Format: [d-M-Y h:i:s] <type> at <file> line <line>: <errormessage> <url>
     * 
     * @todo Detect script path for CLI errors
     * @todo Log detailed errors to full file
     * @deprecated 2.5 See SS_Log on setting up error file logging
     */
    protected static function log_error_if_necessary($errno, $errstr, $errfile, $errline, $errcontext, $errtype)
    {
        user_error('Debug::log_error_if_necessary() and Debug::log_errors_to() are deprecated. Please use SS_Log instead.
			See the class documentation in SS_Log.php for more information.', E_USER_NOTICE);
        $priority = $errtype == 'Error' ? SS_Log::ERR : SS_Log::WARN;
        $writer = new SS_LogFileWriter('../' . self::$log_errors_to);
        SS_Log::add_writer($writer, $priority);
        SS_Log::log(array('errno' => $errno, 'errstr' => $errstr, 'errfile' => $errfile, 'errline' => $errline, 'errcontext' => $errcontext), $priority);
        SS_Log::remove_writer($writer);
    }
开发者ID:Raiser,项目名称:Praktikum,代码行数:20,代码来源:Debug.php


注:本文中的SS_Log::remove_writer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。