forked from leftypol/leftypol
context.php: update LogDriver
This commit is contained in:
parent
79523f8251
commit
6132084b4b
1 changed files with 5 additions and 8 deletions
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
namespace Vichan;
|
||||
|
||||
use Vichan\Data\Driver\CacheDriver;
|
||||
use Vichan\Data\{IpNoteQueries, ReportQueries, UserPostQueries};
|
||||
use Vichan\Data\Driver\{LogDriver, LogDrivers};
|
||||
use Vichan\Data\Driver\{CacheDriver, ErrorLogLogDriver, FileLogDriver, LogDriver, StderrLogDriver, SyslogLogDriver};
|
||||
|
||||
defined('TINYBOARD') or exit;
|
||||
|
||||
|
@ -41,15 +40,13 @@ function build_context(array $config): Context {
|
|||
|
||||
// Check 'syslog' for backwards compatibility.
|
||||
if ((isset($config['syslog']) && $config['syslog']) || $backend === 'syslog') {
|
||||
return LogDrivers::syslog($name, $level, $this->config['log_system']['syslog_stderr']);
|
||||
return new SyslogLogDriver($name, $level, $this->config['log_system']['syslog_stderr']);
|
||||
} elseif ($backend === 'file') {
|
||||
return LogDrivers::file($name, $level, $this->config['log_system']['file_path']);
|
||||
return new FileLogDriver($name, $level, $this->config['log_system']['file_path']);
|
||||
} elseif ($backend === 'stderr') {
|
||||
return LogDrivers::stderr($name, $level);
|
||||
} elseif ($backend === 'none') {
|
||||
return LogDrivers::none();
|
||||
return new StderrLogDriver($name, $level);
|
||||
} else {
|
||||
return LogDrivers::error_log($name, $level);
|
||||
return new ErrorLogLogDriver($name, $level);
|
||||
}
|
||||
},
|
||||
CacheDriver::class => function($c) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue