Created
April 10, 2013 11:22
-
-
Save fetus-hina/5353809 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class PunpunmaruLogRoute extends CLogRoute { | |
public $output = STDERR; | |
public $words = array( | |
'profile' => 'おこ', | |
'trace' => 'まじおこ', | |
'info' => '激おこぷんぷん丸', | |
'warning' => 'ムカ着火ファイヤー', | |
'error' => '激おこスティックファイナリアリティぷんぷんドリーム', | |
); | |
public function init() { | |
parent::init(); | |
} | |
protected function processLogs($logs) { | |
foreach($logs as $log) { | |
@fwrite( | |
$this->output, | |
$this->formatLogMessage($log[0], $log[1], $log[2], $log[3]) | |
); | |
} | |
} | |
protected function formatLogMessage($message, $level, $category, $time) { | |
if(!isset($this->words[$level])) { | |
return ''; | |
} | |
return parent::formatLogMessage($message, $this->words[$level], $category, $time); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment