Add custom error handler to log through new logging code

This commit is contained in:
2011-04-25 00:43:46 +01:00
parent 0260adb4b4
commit e2648d4c08
3 changed files with 59 additions and 0 deletions

View File

@@ -117,6 +117,11 @@ class SihnonFramework_LogEntry {
$logger->log($entry);
}
public static function logInternal($logger, $severity, $file, $line, $message, $category = SihnonFramework_Log::CATEGORY_DEFAULT) {
$entry = new self($severity, $category, time(), getmypid(), $file, $line, $message);
$logger->log($entry);
}
public static function debug($logger, $message, $category = SihnonFramework_Log::CATEGORY_DEFAULT) {
static::log($logger, SihnonFramework_Log::LEVEL_DEBUG, $message, $category);
}