Skip to content

Commit

Permalink
set debug log level in config
Browse files Browse the repository at this point in the history
  • Loading branch information
elnosh committed Oct 23, 2024
1 parent 8f64267 commit 52bd07d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/mint/mint.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os"
"os/signal"
"strconv"
"strings"
"syscall"

"github.com/elnosh/gonuts/cashu/nuts/nut06"
Expand Down Expand Up @@ -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,
Expand All @@ -140,6 +146,7 @@ func configFromEnv() (*mint.Config, error) {
MintInfo: mintInfo,
Limits: mintLimits,
LightningClient: lndClient,
LogLevel: logLevel,
}, nil
}

Expand Down

0 comments on commit 52bd07d

Please sign in to comment.