diff --git a/config.example.yml b/config.example.yml index d5d4664..51ef4a3 100644 --- a/config.example.yml +++ b/config.example.yml @@ -2,7 +2,7 @@ notification: - type: Ntfy domain: https://ntfy.jcktrue.dk topic: backup -log: output.log +log: output.log rclone: options: bwlimit: 6M diff --git a/src/App.php b/src/App.php index 20814d8..795e61d 100644 --- a/src/App.php +++ b/src/App.php @@ -53,7 +53,7 @@ class App function (string $path): bool { return touch($path); } - )->required(), + ), 'templates' => Expect::structure(['notify' => Expect::string()]) ]); @@ -61,12 +61,13 @@ class App $parsedConfig = $parser->parseFile($configFile); - // Merge those values into your configuration schema: + // Merge those values into the configuration schema: $this->config->merge($parsedConfig); $logger = new Logger('app'); if ($this->config->get('log')) { $logger->pushHandler(new StreamHandler($this->config->get('log'))); + $logger->info("Logging enabled"); } $logger->info("Initialization complete"); @@ -81,7 +82,9 @@ class App */ public function getConfig(string $key): mixed { - return $this->config->get($key); + $ret = $this->config->get($key); + $this->logger->debug("Fetching configuration key",[$key,$ret]); + return $ret; } /**