all repos — searchix @ 99d5507b223baa6c780707d32c7bbbb8611034f0

Search engine for NixOS, nix-darwin, home-manager and NUR users

feat: allow configuration of log level

Alan Pearce
commit

99d5507b223baa6c780707d32c7bbbb8611034f0

parent

14c1ddaf7c5468c5966b0c1585f19a5ff39c206d

1 file changed, 3 insertions(+), 1 deletion(-)

changed files
M import/main.goimport/main.go
@@ -20,7 +20,8 @@
const timeout = 30 * time.Minute type Config struct { - ConfigFile string `conf:"short:c"` + ConfigFile string `conf:"short:c"` + LogLevel slog.Level `conf:"default:INFO"` } func main() {
@@ -36,6 +37,7 @@ os.Exit(1)
} log.Panicf("parsing runtime configuration: %v", err) } + slog.SetLogLoggerLevel(runtimeConfig.LogLevel) cfg, err := config.GetConfig(runtimeConfig.ConfigFile) if err != nil {