feat: implement centralized logging helper

- remove direct log usage
- create a new logging helper
- update all log calls to use the new Logger instance
- set timestamp to ISO8601

🤖
This commit is contained in:
Sebastian Mark 2024-11-03 22:22:03 +01:00
parent ebc81657f5
commit 561419b568
6 changed files with 24 additions and 14 deletions

View file

@ -1,7 +1,6 @@
package helper
import (
"github.com/charmbracelet/log"
"gopkg.in/yaml.v3"
"os"
"path/filepath"
@ -33,12 +32,12 @@ func ParseConfig(filename string) ChronoTomato.Config {
yamlFile, err := os.ReadFile(expandUnixPath(filename))
if err != nil {
log.Fatal("Error opening config file!", "reason", err)
Logger.Fatal("Error opening config file!", "reason", err)
}
err = yaml.Unmarshal(yamlFile, &config)
if err != nil {
log.Fatalf("Unmarshal: %v", err)
Logger.Fatalf("Unmarshal: %v", err)
}
return config