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


PHP SS_Log::get_writers方法代码示例

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


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

示例1: 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

示例2: getLogWriters

 /**
  * Get the current SS log writers and their default configuration
  */
 public function getLogWriters()
 {
     $writers = SS_Log::get_writers();
     if ($writers && !empty($writers)) {
         $writersArray = ArrayList::create();
         foreach ($writers as $writer) {
             $writersArray->push(ArrayData::create(array("Type" => get_class($writer), "Details" => reset($writer))));
         }
         return $writersArray;
     }
     return false;
 }
开发者ID:platocreative,项目名称:silverstripe-healthcheck,代码行数:15,代码来源:HealthCheck_Controller.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: run

 public function run($request)
 {
     $writers = SS_Log::get_writers();
     print "<pre>The following log writers have been registered:" . PHP_EOL;
     foreach ($writers as $w) {
         printf(" * %s" . PHP_EOL, get_class($w));
         if (get_class($w) == 'BugzScoutLogWriter') {
             $lw = $w;
         }
     }
     if ($lw) {
         printf('</pre><p>This task forces an error. If configured correctly, a new bug will be opened in <a href="%s">%s</a>.</p>', $lw->host(), $lw->host());
         user_error('test error');
     } else {
         print "</pre><p>No BugzScoutLogWriter instances found. Please review your setup.</p>";
     }
 }
开发者ID:helpfulrobot,项目名称:svandragt-bugzscoutlogwriter,代码行数:17,代码来源:BugzScoutLogWriterTestTask.php


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