Changing the way loggers are loaded, this will probable need some changes on userland

This commit is contained in:
José Lorenzo Rodríguez 2010-12-04 13:56:26 -04:30
parent ff8b1a1041
commit 80452397b6

View file

@ -124,15 +124,9 @@ class CakeLog {
* @return mixed boolean false on any failures, string of classname to use if search was successful. * @return mixed boolean false on any failures, string of classname to use if search was successful.
*/ */
protected static function _getLogger($loggerName) { protected static function _getLogger($loggerName) {
list($plugin, $loggerName) = pluginSplit($loggerName); list($plugin, $loggerName) = pluginSplit($loggerName, true);
if ($plugin) { App::uses($loggerName, $plugin . 'Log/Engine');
App::import('Lib', $plugin . '.log/' . $loggerName);
} else {
if (!App::import('Lib', 'log/' . $loggerName)) {
App::import('Core', 'log/' . $loggerName);
}
}
if (!class_exists($loggerName)) { if (!class_exists($loggerName)) {
throw new Exception(sprintf(__('Could not load class %s'), $loggerName)); throw new Exception(sprintf(__('Could not load class %s'), $loggerName));
} }
@ -165,9 +159,7 @@ class CakeLog {
* @return void * @return void
*/ */
protected static function _autoConfig() { protected static function _autoConfig() {
if (!class_exists('FileLog')) { self::_getLogger('FileLog');
App::import('Core', 'log/FileLog');
}
self::$_streams['default'] = new FileLog(array('path' => LOGS)); self::$_streams['default'] = new FileLog(array('path' => LOGS));
} }