Skip to content
Browse files

ensure that plain CakeLogInterface still works

  • Loading branch information...
1 parent 8e8763d commit 595cad84b3225a8aff4ed1bfbd24c9ecbf97d48c @rchavik rchavik committed
View
8 lib/Cake/Log/CakeLog.php
@@ -374,8 +374,12 @@ public static function write($type, $message, $scope = array()) {
$scopes = array();
if ($logger instanceof BaseLog) {
$config = $logger->config();
- $types = $config['types'];
- $scopes = $config['scopes'];
+ if (isset($config['types'])) {
+ $types = $config['types'];
+ }
+ if (isset($config['scopes'])) {
+ $scopes = $config['scopes'];
+ }
}
if (is_string($scope)) {
$inScope = in_array($scope, $scopes);
View
2 lib/Cake/Test/Case/Log/CakeLogTest.php
@@ -64,6 +64,8 @@ public function testImportingLoggers() {
$this->assertTrue($result);
$this->assertEquals(CakeLog::configured(), array('libtest', 'plugintest'));
+ CakeLog::write(LOG_INFO, 'TestPluginLog is not a BaseLog descendant');
+
App::build();
CakePlugin::unload();
}
View
5 lib/Cake/Test/test_app/Plugin/TestPlugin/Lib/Log/Engine/TestPluginLog.php
@@ -17,9 +17,10 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('BaseLog', 'Log/Engine');
+App::uses('CakeLogInterface', 'Log');
-class TestPluginLog extends BaseLog {
+class TestPluginLog implements CakeLogInterface
+{
public function write($type, $message) {
}

0 comments on commit 595cad8

Please sign in to comment.
Something went wrong with that request. Please try again.