From 6f97bf10e7a741bf59f6e72112a3bdee8b042ce3 Mon Sep 17 00:00:00 2001 From: Awilum Date: Thu, 17 Jan 2013 23:18:23 +0200 Subject: [PATCH] Gelato: general updates. --- libraries/Gelato/ErrorHandler/ErrorHandler.php | 7 ++----- libraries/Gelato/Gelato.php | 14 +++++++++++++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/libraries/Gelato/ErrorHandler/ErrorHandler.php b/libraries/Gelato/ErrorHandler/ErrorHandler.php index 2f5b9a8..6edd8d9 100644 --- a/libraries/Gelato/ErrorHandler/ErrorHandler.php +++ b/libraries/Gelato/ErrorHandler/ErrorHandler.php @@ -248,11 +248,8 @@ class ErrorHandler $error['type'] = get_class($exception); } - // @todo Write to error log - - /*if () { - Write here - }*/ + // Write to log + Log::write("{$error['type']}: {$error['message']} in {$error['file']} at line {$error['line']}"); // Send headers and output @header('Content-Type: text/html; charset=UTF-8'); diff --git a/libraries/Gelato/Gelato.php b/libraries/Gelato/Gelato.php index c07419a..794093e 100644 --- a/libraries/Gelato/Gelato.php +++ b/libraries/Gelato/Gelato.php @@ -28,12 +28,24 @@ if ( ! defined('GELATO_DISPLAY_ERRORS')) { } /** - * Display Gelato Autoloader or not ? + * Use Gelato Autoloader or not ? */ if ( ! defined('GELATO_AUTOLOADER')) { define('GELATO_AUTOLOADER', true); } +/** + * Load Gelato Logger + */ +require_once __DIR__ . '/Log/Log.php'; + +/** + * Use Gelato Logger default path or not ? + */ +if ( ! defined('GELATO_LOGGER')) { + Log::configure('path', __DIR__. '/_logs'); +} + /** * Load Gelato Error Handler */