Skip to content

Commit

Permalink
Changing the way loggers are loaded, this will probable need some cha…
Browse files Browse the repository at this point in the history
…nges on userland
  • Loading branch information
lorenzo committed Dec 4, 2010
1 parent ff8b1a1 commit 8045239
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions lib/Cake/Log/CakeLog.php
Expand Up @@ -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));
}
Expand Down Expand Up @@ -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));
}

Expand Down

0 comments on commit 8045239

Please sign in to comment.