From 44c89408d2cae16aded0c8d743071d577ff0e3fe Mon Sep 17 00:00:00 2001 From: Elara Musayelyan Date: Sat, 23 Apr 2022 20:20:13 -0700 Subject: [PATCH] Add debug logs --- go.mod | 2 +- go.sum | 4 ++-- itd.toml | 5 ++++- main.go | 7 ++++++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 056c0ae..8d4c212 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/smallnest/rpcx v1.7.4 github.com/urfave/cli/v2 v2.3.0 github.com/vmihailenco/msgpack/v5 v5.3.5 - go.arsenm.dev/infinitime v0.0.0-20220424014025-bebd1017c532 + go.arsenm.dev/infinitime v0.0.0-20220424030849-6c3f1b14c948 golang.org/x/text v0.3.7 ) diff --git a/go.sum b/go.sum index 547652f..3a84264 100644 --- a/go.sum +++ b/go.sum @@ -560,8 +560,8 @@ github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.4 h1:zNWRjYUW32G9KirMXYHQHVNFkXvMI7LpgNW2AgYAoIs= github.com/yuin/goldmark v1.4.4/go.mod h1:rmuwmfZ0+bvzB24eSC//bk1R1Zp3hM0OXYv/G2LIilg= -go.arsenm.dev/infinitime v0.0.0-20220424014025-bebd1017c532 h1:HOFaxlEKacGw1nDs23qRv+FTX+PR+v4l1Sujfq5S3pc= -go.arsenm.dev/infinitime v0.0.0-20220424014025-bebd1017c532/go.mod h1:1cBQ3fp6QlRbSqu9kEBAHsVThINj31FtqHIYVsQ7wgg= +go.arsenm.dev/infinitime v0.0.0-20220424030849-6c3f1b14c948 h1:OX1SyEIFz4ae2z468lBQvRTNRvqLEwjfJ8lcssUH5+w= +go.arsenm.dev/infinitime v0.0.0-20220424030849-6c3f1b14c948/go.mod h1:1cBQ3fp6QlRbSqu9kEBAHsVThINj31FtqHIYVsQ7wgg= go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= go.opentelemetry.io/otel v0.19.0/go.mod h1:j9bF567N9EfomkSidSfmMwIwIBuP37AMAIzVW85OxSg= go.opentelemetry.io/otel v1.6.3 h1:FLOfo8f9JzFVFVyU+MSRJc2HdEAXQgm7pIv2uFKRSZE= diff --git a/itd.toml b/itd.toml index 42f2214..4e3385e 100644 --- a/itd.toml +++ b/itd.toml @@ -28,4 +28,7 @@ [weather] enabled = true - location = "Los Angeles, CA" \ No newline at end of file + location = "Los Angeles, CA" + +[logging] + level = "info" \ No newline at end of file diff --git a/main.go b/main.go index 470270c..abdf3fe 100644 --- a/main.go +++ b/main.go @@ -54,6 +54,11 @@ func main() { return } + level, err := zerolog.ParseLevel(k.String("logging.level")) + if err != nil || level == zerolog.NoLevel { + level = zerolog.InfoLevel + } + // Initialize infinitime library infinitime.Init() // Cleanly exit after function @@ -66,7 +71,7 @@ func main() { Whitelist: k.Strings("conn.whitelist.devices"), OnReqPasskey: onReqPasskey, Logger: log.Logger, - LogLevel: zerolog.WarnLevel, + LogLevel: level, } // Connect to InfiniTime with default options