From 52bd07de6b57f84eb97066c498dc1514efceea76 Mon Sep 17 00:00:00 2001 From: elnosh Date: Wed, 23 Oct 2024 13:09:35 -0500 Subject: [PATCH] set debug log level in config --- cmd/mint/mint.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/mint/mint.go b/cmd/mint/mint.go index 9ee8a82..0670dc9 100644 --- a/cmd/mint/mint.go +++ b/cmd/mint/mint.go @@ -8,6 +8,7 @@ import ( "os" "os/signal" "strconv" + "strings" "syscall" "github.com/elnosh/gonuts/cashu/nuts/nut06" @@ -131,6 +132,11 @@ func configFromEnv() (*mint.Config, error) { return nil, fmt.Errorf("error setting LND client: %v", err) } + logLevel := mint.Info + if strings.ToLower(os.Getenv("LOG")) == "debug" { + logLevel = mint.Debug + } + return &mint.Config{ DerivationPathIdx: uint32(derivationPathIdx), Port: port, @@ -140,6 +146,7 @@ func configFromEnv() (*mint.Config, error) { MintInfo: mintInfo, Limits: mintLimits, LightningClient: lndClient, + LogLevel: logLevel, }, nil }