mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-08 16:14:26 +02:00
Refactoring Logging to use Configuration
This commit is contained in:
parent
eafcf3592d
commit
80f1feabe5
13 changed files with 141 additions and 146 deletions
29
src/App.php
29
src/App.php
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue