[TASK] Support logger names with namespaces
authorSteffen Müller <typo3@t3node.com>
Fri, 12 Oct 2012 23:08:26 +0000 (01:08 +0200)
committerIngo Renner <ingo@typo3.org>
Mon, 22 Oct 2012 20:23:57 +0000 (22:23 +0200)
Resolves: #41943
Releases: 6.0

Change-Id: Ie9ee6fd200a330d7c78285afc380d1d59d4ec03a
Reviewed-on: http://review.typo3.org/15545
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
Reviewed-by: Philipp Gampe
Reviewed-by: Ingo Renner
Tested-by: Ingo Renner
typo3/sysext/core/Classes/Log/LogManager.php

index 0db964a..e528da4 100644 (file)
@@ -92,8 +92,9 @@ class LogManager implements \TYPO3\CMS\Core\SingletonInterface {
        public function getLogger($name = '') {
                /** @var $logger \TYPO3\CMS\Core\Log\Logger */
                $logger = NULL;
-               // Transform class names to the dot-name style
-               $name = str_replace('_', '.', $name);
+               // Transform namespaces and underscore class names to the dot-name style
+               $separators = array('_', '\\');
+               $name = str_replace($separators, '.', $name);
                if (isset($this->loggers[$name])) {
                        $logger = $this->loggers[$name];
                } else {