/** * ログを整形する * * @param Log $log * @return string */ public function format(Log $log) { return vsprintf($this->_compiled_format, ['[' . $log->getTag() . ']', $log->getMsg(), LogLevel::toString($log->getLevel()), json_encode($log->getArgs(), JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE), date($this->_date_format, $log->getTime())]); }
public function write(Log $log) { if ($log->getLevel() <= $this->_level) { $this->writeImpl($log); } }