From 7e862e1bd62f1e1e25f6cec5cf740aa3d3a5b835 Mon Sep 17 00:00:00 2001 From: winter Date: Tue, 14 Jan 2025 18:38:40 +0000 Subject: add request logging to router --- Digitigrade/GlobalConfig.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Digitigrade/GlobalConfig.php') diff --git a/Digitigrade/GlobalConfig.php b/Digitigrade/GlobalConfig.php index 7fbfab3..63a1031 100644 --- a/Digitigrade/GlobalConfig.php +++ b/Digitigrade/GlobalConfig.php @@ -28,6 +28,16 @@ class GlobalConfig extends Singleton { return $this->confData['debug']['send_tracebacks'] ?? false; } + public function getLogLevel(): int { + return match ($this->confData['debug']['log_level']) { + 'debug' => Logger::LEVEL_DEBUG, + 'info' => Logger::LEVEL_INFO, + 'warning' => Logger::LEVEL_WARNING, + 'error' => Logger::LEVEL_ERROR, + default => Logger::LEVEL_INFO + }; + } + public function getDbConnection(): string { return 'pgsql:host=' . $this->confData['database']['host'] . ';port=' . $this->confData['database']['port'] . -- cgit v1.3