[FEATURE] Add LogManagerInterface 91/31791/3
authorSteffen Müller <typo3@t3node.com>
Fri, 25 Jul 2014 09:03:59 +0000 (11:03 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 25 Jul 2014 10:00:18 +0000 (12:00 +0200)
The interface \TYPO3\CMS\Core\Log\LogManagerInterface enables you
to ship an alternative 3rd party LogManager instance.
Having dependency injection in place, you could replace the core
Logger without touching a single line of code.

Releases: 6.3
Resolves: #60551
Change-Id: I2bf125f93599dee9a08e6c6b6fa7c369a7680d8d
Reviewed-on: http://review.typo3.org/31791
Reviewed-by: Sascha Egerer <sascha@sascha-egerer.de>
Tested-by: Sascha Egerer <sascha@sascha-egerer.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Classes/Log/LogManager.php
typo3/sysext/core/Classes/Log/LogManagerInterface.php [new file with mode: 0644]

index f2f9642..236c08f 100644 (file)
@@ -22,7 +22,7 @@ namespace TYPO3\CMS\Core\Log;
  * @author Steffen Müller <typo3@t3node.com>
  * @author Steffen Gebert <steffen.gebert@typo3.org>
  */
  * @author Steffen Müller <typo3@t3node.com>
  * @author Steffen Gebert <steffen.gebert@typo3.org>
  */
-class LogManager implements \TYPO3\CMS\Core\SingletonInterface {
+class LogManager implements \TYPO3\CMS\Core\SingletonInterface, LogManagerInterface {
 
        /**
         * @var string
 
        /**
         * @var string
diff --git a/typo3/sysext/core/Classes/Log/LogManagerInterface.php b/typo3/sysext/core/Classes/Log/LogManagerInterface.php
new file mode 100644 (file)
index 0000000..408ce97
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+namespace TYPO3\CMS\Core\Log;
+
+/**
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * LogManager Contract for delivering log instances.
+ *
+ * @author Steffen Müller <typo3@t3node.com>
+ */
+interface LogManagerInterface {
+
+       /**
+        * Gets a logger instance for the given name.
+        *
+        * @param string $name
+        * @return \Psr\Log\LoggerInterface
+        */
+       public function getLogger($name = '');
+
+}