|
|
|
@ -151,11 +151,15 @@ class Harmonious_Logger { |
|
|
|
throw new RuntimeException("Log directory '$dir' not writable."); |
|
|
|
throw new RuntimeException("Log directory '$dir' not writable."); |
|
|
|
} |
|
|
|
} |
|
|
|
if ( $level <= $this->getLevel() ) { |
|
|
|
if ( $level <= $this->getLevel() ) { |
|
|
|
if (is_string($data)) $message = $data; |
|
|
|
if (is_object($data)) $data = (array)$data; |
|
|
|
elseif (isset($data['message'])) $message = (string)$data['message']; |
|
|
|
if (is_array($data)) { |
|
|
|
else { |
|
|
|
if (isset($data['message'])) $message = (string)$data['message']; |
|
|
|
reset($data); |
|
|
|
else { |
|
|
|
$message = (string)current($data); |
|
|
|
reset($data); |
|
|
|
|
|
|
|
$message = (string)current($data); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
$message = (string)$data; |
|
|
|
} |
|
|
|
} |
|
|
|
$this->write(sprintf("[%s] %s - %s\r\n", $this->levels[$level], date('c'), $message)); |
|
|
|
$this->write(sprintf("[%s] %s - %s\r\n", $this->levels[$level], date('c'), $message)); |
|
|
|
} |
|
|
|
} |
|
|
|
|