From e29bc93f359665f680bb2b9eebd41df68793ce2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Wed, 24 Jan 2024 00:09:48 -0800 Subject: [PATCH] show timestamp for logger --- internal/config/config.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/config/config.go b/internal/config/config.go index bab954f..bff5efd 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -3,6 +3,7 @@ package config import ( "math" "os" + "time" "git.burning.moe/celediel/burning.moe/internal/models" "github.com/charmbracelet/log" @@ -35,7 +36,10 @@ type ConfigDatabase struct { // Initialises the app wide AppConfig, loads values from environment, and set up the Logger func Initialise() AppConfig { app := *defaults - app.Logger = log.New(os.Stderr) + app.Logger = log.NewWithOptions(os.Stderr, log.Options{ + ReportTimestamp: true, + TimeFormat: time.TimeOnly, + }) // load values from config if cfg, err := loadConfig(); err == nil {