From 80452397b6a65619b7d6d43914e5b1d546f25f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?= Date: Sat, 4 Dec 2010 13:56:26 -0430 Subject: [PATCH] Changing the way loggers are loaded, this will probable need some changes on userland --- lib/Cake/Log/CakeLog.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/Cake/Log/CakeLog.php b/lib/Cake/Log/CakeLog.php index f1c5b32cf0f..f09f9c79bc6 100644 --- a/lib/Cake/Log/CakeLog.php +++ b/lib/Cake/Log/CakeLog.php @@ -124,15 +124,9 @@ public static function config($key, $config) { * @return mixed boolean false on any failures, string of classname to use if search was successful. */ protected static function _getLogger($loggerName) { - list($plugin, $loggerName) = pluginSplit($loggerName); + list($plugin, $loggerName) = pluginSplit($loggerName, true); - if ($plugin) { - App::import('Lib', $plugin . '.log/' . $loggerName); - } else { - if (!App::import('Lib', 'log/' . $loggerName)) { - App::import('Core', 'log/' . $loggerName); - } - } + App::uses($loggerName, $plugin . 'Log/Engine'); if (!class_exists($loggerName)) { throw new Exception(sprintf(__('Could not load class %s'), $loggerName)); } @@ -165,9 +159,7 @@ public static function drop($streamName) { * @return void */ protected static function _autoConfig() { - if (!class_exists('FileLog')) { - App::import('Core', 'log/FileLog'); - } + self::_getLogger('FileLog'); self::$_streams['default'] = new FileLog(array('path' => LOGS)); }