Skip to content
Snippets Groups Projects
Commit 905e1957 authored by Demian Katz's avatar Demian Katz
Browse files

Load logger through service manager.

parent 48fd196b
No related merge requests found
...@@ -262,12 +262,12 @@ $config = array( ...@@ -262,12 +262,12 @@ $config = array(
'factories' => array( 'factories' => array(
'worldcatconnection' => function ($sm) { 'worldcatconnection' => function ($sm) {
$wc = new \VuFind\Connection\WorldCat(); $wc = new \VuFind\Connection\WorldCat();
$wc->setLogger(\VuFind\Log\Logger::getInstance()); $wc->setLogger($sm->get('Logger'));
return $wc; return $wc;
}, },
'worldcatutils' => function ($sm) { 'worldcatutils' => function ($sm) {
$wcu = new \VuFind\Connection\WorldCatUtils(); $wcu = new \VuFind\Connection\WorldCatUtils();
$wcu->setLogger(\VuFind\Log\Logger::getInstance()); $wcu->setLogger($sm->get('Logger'));
return $wcu; return $wcu;
}, },
), ),
...@@ -275,6 +275,7 @@ $config = array( ...@@ -275,6 +275,7 @@ $config = array(
'authmanager' => 'VuFind\Auth\Manager', 'authmanager' => 'VuFind\Auth\Manager',
'cart' => 'VuFind\Cart', 'cart' => 'VuFind\Cart',
'cachemanager' => 'VuFind\Cache\Manager', 'cachemanager' => 'VuFind\Cache\Manager',
'logger' => 'VuFind\Log\Logger',
'recordloader' => 'VuFind\Record\Loader', 'recordloader' => 'VuFind\Record\Loader',
'searchspecsreader' => 'VuFind\Config\SearchSpecsReader', 'searchspecsreader' => 'VuFind\Config\SearchSpecsReader',
'sessionmanager' => 'Zend\Session\SessionManager', 'sessionmanager' => 'Zend\Session\SessionManager',
......
...@@ -117,7 +117,7 @@ class Manager ...@@ -117,7 +117,7 @@ class Manager
$index->setServiceLocator(self::$serviceLocator); $index->setServiceLocator(self::$serviceLocator);
// Set the logger: // Set the logger:
$index->setLogger(\VuFind\Log\Logger::getInstance()); $index->setLogger(self::$serviceLocator->get('Logger'));
return $index; return $index;
} }
......
...@@ -54,7 +54,7 @@ class CoverController extends AbstractBase ...@@ -54,7 +54,7 @@ class CoverController extends AbstractBase
ConfigReader::getConfig(), ConfigReader::getConfig(),
$this->getServiceLocator()->get('CacheManager')->getCacheDir() $this->getServiceLocator()->get('CacheManager')->getCacheDir()
); );
$this->loader->setLogger(\VuFind\Log\Logger::getInstance()); $this->loader->setLogger($this->getServiceLocator()->get('Logger'));
} }
return $this->loader; return $this->loader;
} }
......
...@@ -204,20 +204,6 @@ class Logger extends BaseLogger ...@@ -204,20 +204,6 @@ class Logger extends BaseLogger
} }
} }
/**
* Get the logger instance.
*
* @return Logger
*/
public static function getInstance()
{
static $instance;
if (!$instance) {
$instance = new Logger();
}
return $instance;
}
/** /**
* Is one of the log writers listening for debug messages? (This is useful to * Is one of the log writers listening for debug messages? (This is useful to
* know, since some code can save time that would be otherwise wasted generating * know, since some code can save time that would be otherwise wasted generating
......
...@@ -60,7 +60,7 @@ class Results extends BaseResults ...@@ -60,7 +60,7 @@ class Results extends BaseResults
$id = isset($config->Summon->apiId) ? $config->Summon->apiId : null; $id = isset($config->Summon->apiId) ? $config->Summon->apiId : null;
$key = isset($config->Summon->apiKey) ? $config->Summon->apiKey : null; $key = isset($config->Summon->apiKey) ? $config->Summon->apiKey : null;
$conn = new SummonConnection($id, $key); $conn = new SummonConnection($id, $key);
$conn->setLogger(\VuFind\Log\Logger::getInstance()); $conn->setLogger($this->getServiceLocator()->get('Logger'));
} }
return $conn; return $conn;
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment