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