diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-10-10 08:52:46 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-10-11 00:15:03 +0400 |
commit | c782b8ccd740a206bf2b7af393dcade94a38ef7d (patch) | |
tree | 1c9d40a922785b2aa279857a1520a6eb6781bdb7 /core/Log.php | |
parent | a4972f38678207e649a20f1b5ac281a679bf92fa (diff) |
Refs #4208 refactor all singletons except the hard ones (with custom getInstance()
(some tests failing)
Diffstat (limited to 'core/Log.php')
-rw-r--r-- | core/Log.php | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/core/Log.php b/core/Log.php index 026f63c839..23017acd59 100644 --- a/core/Log.php +++ b/core/Log.php @@ -26,7 +26,7 @@ use Piwik\Db; * The logging utility can be configured by manipulating the INI config options in the * [log] section. */ -class Log +class Log extends Singleton { // log levels const NONE = 0; @@ -51,35 +51,6 @@ class Log const GET_AVAILABLE_WRITERS_EVENT = 'Log.getAvailableWriters'; /** - * The singleton Log instance. - * - * @var Log - */ - private static $instance = null; - - /** - * Returns the singleton Log instance or creates it if it doesn't exist. - * - * @return Log - */ - public static function getInstance() - { - if (self::$instance === null) { - self::$instance = new Log(); - } - return self::$instance; - } - - /** - * Unsets the singleton instance so it will be re-created the next time getInstance() is - * called. For testing purposes only. - */ - public static function clearInstance() - { - self::$instance = null; - } - - /** * The current logging level. Everything of equal or greater priority will be logged. * Everything else will be ignored. * @@ -120,7 +91,7 @@ class Log /** * Constructor. */ - private function __construct() + protected function __construct() { $logConfig = Config::getInstance()->log; $this->setCurrentLogLevelFromConfig($logConfig); |