Skip to content

Instantly share code, notes, and snippets.

@fetus-hina
Created April 10, 2013 11:22
Show Gist options
  • Save fetus-hina/5353809 to your computer and use it in GitHub Desktop.
Save fetus-hina/5353809 to your computer and use it in GitHub Desktop.
<?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