\TamerLib\Classes\ > RedisServer > start() now starts the server with a matching logging level to net.nosial.loglib

This commit is contained in:
Netkas 2023-07-06 18:05:21 -04:00
parent 264fea0c7c
commit cf912dad6d
No known key found for this signature in database
GPG key ID: 5DAF58535614062B
2 changed files with 19 additions and 1 deletions

View file

@ -4,6 +4,7 @@
namespace TamerLib\Classes;
use LogLib\Abstracts\LevelType;
use LogLib\Log;
use Redis;
use RedisException;
@ -74,7 +75,18 @@
}
Log::verbose(Utilities::getName(), 'Starting server on port ' . $this->configuration->getPort() . '.');
$this->server_process = new Process([$this->cmd, '--port', $this->configuration->getPort()]);
$log_level = match (\LogLib\Classes\Utilities::getLogLevel())
{
LevelType::Warning, LevelType::Error => 'warning',
LevelType::Verbose => 'verbose',
LevelType::Debug => 'debug',
default => 'notice',
};
$this->server_process = new Process([
$this->cmd, '--port', $this->configuration->getPort(), '--loglevel', $log_level
]);
$this->server_process->start();
// Use a redis client and ping the server until it responds.