Refactoring Logging to use Configuration

This commit is contained in:
Philipp Holzer 2019-02-11 21:13:53 +01:00
parent eafcf3592d
commit 80f1feabe5
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
13 changed files with 141 additions and 146 deletions

View file

@ -109,11 +109,6 @@ class App
*/
public $mobileDetect;
/**
* @var LoggerInterface The current logger of this App
*/
private $logger;
/**
* @var Configuration The config
*/
@ -339,35 +334,13 @@ class App
return $this->mode;
}
/**
* Returns the Logger of the Application
*
* @return LoggerInterface The Logger
* @throws InternalServerErrorException when the logger isn't created
*/
public function getLogger()
{
if (empty($this->logger)) {
throw new InternalServerErrorException('Logger of the Application is not defined');
}
return $this->logger;
}
/**
* Reloads the whole app instance
*/
public function reload()
{
$this->getMode()->determine($this->basePath);
$this->determineURLPath();
if ($this->getMode()->has(App\Mode::DBCONFIGAVAILABLE)) {
Core\Config::load();
}
// again because DB-config could change the config
$this->getMode()->determine($this->basePath);
if ($this->getMode()->has(App\Mode::DBAVAILABLE)) {
@ -382,8 +355,6 @@ class App
Core\L10n::init();
$this->process_id = Core\System::processID('log');
Core\Logger::setLogger($this->logger);
}
/**