本文整理汇总了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);
}
示例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));
}
示例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));
}
示例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);
}
示例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);
}