From 305e13d761b7154d1d58594ea72430e33858f3d3 Mon Sep 17 00:00:00 2001 From: Laurent Demailly Date: Tue, 1 Aug 2023 09:53:01 -0700 Subject: [PATCH] pickup newer cli and colorize a bit more using structured logging (#21) --- go.mod | 6 +++--- go.sum | 12 ++++++------ scli.go | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 4814ef7..9b73890 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,9 @@ module fortio.org/scli go 1.18 require ( - fortio.org/cli v1.2.0 + fortio.org/cli v1.3.0 fortio.org/dflag v1.5.2 - fortio.org/log v1.8.1 + fortio.org/log v1.9.0 fortio.org/version v1.0.2 golang.org/x/sys v0.10.0 ) @@ -13,5 +13,5 @@ require ( require ( fortio.org/sets v1.0.3 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect - golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 // indirect + golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b // indirect ) diff --git a/go.sum b/go.sum index 4fc6de5..467ffa6 100644 --- a/go.sum +++ b/go.sum @@ -1,18 +1,18 @@ fortio.org/assert v1.1.4 h1:Za1RaG+OjsTMpQS3J3UCvTF6wc4+IOHCz+jAOU37Y4o= -fortio.org/cli v1.2.0 h1:MXmbYnbNHcclf0xYLZjeCnTINby7FpooJxR01+hnBmM= -fortio.org/cli v1.2.0/go.mod h1:zJwHjRnvVqneF7ES+REfElc33xMjhbRDJslSrqIK9Kk= +fortio.org/cli v1.3.0 h1:OsM2P/OIjHFa47mUN914v32ZmgQKJdVrvyiKIYQSaVw= +fortio.org/cli v1.3.0/go.mod h1:eg30mF10yx+T9z6fr1ES87KCfmGaebnhnhbqc8t3IBo= fortio.org/dflag v1.5.2 h1:F9XVRj4Qr2IbJP7BMj7XZc9wB0Q/RZ61Ool+4YPVad8= fortio.org/dflag v1.5.2/go.mod h1:ppb/A8u+KKg+qUUYZNYuvRnXuVb8IsdHb/XGzsmjkN8= -fortio.org/log v1.8.1 h1:Ybtjp+qDXb124ESnZ0XVuXJ6khDrWcom/C55YPupoKg= -fortio.org/log v1.8.1/go.mod h1:u/8/2lyczXq52aT5Nw6reD+3cR6m/EbS2jBiIYhgiTU= +fortio.org/log v1.9.0 h1:BFbM1U5H7droAdf3Ffnm3FgiSZepEjyq3xfrZqhJvHc= +fortio.org/log v1.9.0/go.mod h1:u/8/2lyczXq52aT5Nw6reD+3cR6m/EbS2jBiIYhgiTU= fortio.org/sets v1.0.3 h1:HzewdGjH69YmyW06yzplL35lGr+X4OcqQt0qS6jbaO4= fortio.org/sets v1.0.3/go.mod h1:QZVj0r6KP/ZD9ebySW9SgxVNy/NjghUfyHW9NN+WU+4= fortio.org/version v1.0.2 h1:8NwxdX58aoeKx7T5xAPO0xlUu1Hpk42nRz5s6e6eKZ0= fortio.org/version v1.0.2/go.mod h1:2JQp9Ax+tm6QKiGuzR5nJY63kFeANcgrZ0osoQFDVm0= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 h1:MGwJjxBy0HJshjDNfLsYO8xppfqWlA5ZT9OhtUUhTNw= -golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b h1:r+vk0EmXNmekl0S0BascoeeoHk/L7wmaW2QF90K+kYI= +golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/scli.go b/scli.go index 75f2073..84b3321 100644 --- a/scli.go +++ b/scli.go @@ -101,7 +101,7 @@ func ServerMain() bool { if err != nil { log.Fatalf("Unable to serve config on %s: %v", s.Addr, err) } - log.Infof("Fortio scli %v dflag config server listening on %s", shortScliV, ln.Addr()) + log.S(log.Info, "Fortio scli dflag config server listening", log.Str("version", shortScliV), log.Attr("addr", ln.Addr())) go func() { err := s.Serve(ln) if err != nil { @@ -110,7 +110,7 @@ func ServerMain() bool { }() hasStartedServer = true } - log.Infof("Starting %s %s", cli.ProgramName, cli.LongVersion) + log.S(log.Info, "Starting", log.Str("command", cli.ProgramName), log.Str("version", cli.LongVersion)) return hasStartedServer }