mirror of
https://github.com/friendica/friendica
synced 2025-04-28 13:44:25 +02:00
Fix errors in Core namespace
This commit is contained in:
parent
6ad1dd72d6
commit
496f0755b1
15 changed files with 79 additions and 75 deletions
|
@ -55,7 +55,7 @@ class StreamLogger extends AbstractLogger
|
|||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @param string $level The minimum loglevel at which this logger will be triggered
|
||||
* @param int $logLevel The minimum loglevel at which this logger will be triggered
|
||||
*
|
||||
* @throws LoggerException
|
||||
*/
|
||||
|
|
|
@ -17,7 +17,7 @@ class LoggerSettingsCheck implements ICheckLoggerSettings
|
|||
{
|
||||
/** @var IManageConfigValues */
|
||||
protected $config;
|
||||
/** @var $fileSystem */
|
||||
/** @var FileSystem */
|
||||
protected $fileSystem;
|
||||
/** @var L10n */
|
||||
protected $l10n;
|
||||
|
@ -38,10 +38,8 @@ class LoggerSettingsCheck implements ICheckLoggerSettings
|
|||
|
||||
try {
|
||||
$stream = $this->fileSystem->createStream($file);
|
||||
|
||||
if (!isset($stream)) {
|
||||
throw new LoggerUnusableException('Stream is null.');
|
||||
}
|
||||
} catch (LoggerUnusableException $exception) {
|
||||
throw new LoggerUnusableException('Stream is null.', $exception);
|
||||
} catch (\Throwable $exception) {
|
||||
return $this->l10n->t('The logfile \'%s\' is not usable. No logging possible (error: \'%s\')', $file, $exception->getMessage());
|
||||
}
|
||||
|
@ -57,16 +55,14 @@ class LoggerSettingsCheck implements ICheckLoggerSettings
|
|||
if ($this->config->get('system', 'debugging')) {
|
||||
$file = $this->config->get('system', 'dlogfile');
|
||||
|
||||
if (empty($file)) {
|
||||
if ($file === null || $file === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
$stream = $this->fileSystem->createStream($file);
|
||||
|
||||
if (!isset($stream)) {
|
||||
throw new LoggerUnusableException('Stream is null.');
|
||||
}
|
||||
} catch (LoggerUnusableException $exception) {
|
||||
throw new LoggerUnusableException('Stream is null.', $exception);
|
||||
} catch (\Throwable $exception) {
|
||||
return $this->l10n->t('The debug logfile \'%s\' is not usable. No logging possible (error: \'%s\')', $file, $exception->getMessage());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue