diff options
| author | winter | 2025-01-14 18:38:40 +0000 |
|---|---|---|
| committer | winter | 2025-01-14 18:38:40 +0000 |
| commit | 7e862e1bd62f1e1e25f6cec5cf740aa3d3a5b835 (patch) | |
| tree | 1bb2c49248458f3bd6106d5f8a3ec42bbf8dd358 /Digitigrade/GlobalConfig.php | |
| parent | eda5788d76ecb802fb174968a9ec1fb382670885 (diff) | |
add request logging to router
Diffstat (limited to 'Digitigrade/GlobalConfig.php')
| -rw-r--r-- | Digitigrade/GlobalConfig.php | 10 |
1 files changed, 10 insertions, 0 deletions
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'] . |
