diff --git a/deps.bzl b/deps.bzl index f98e600..92f2d6d 100644 --- a/deps.bzl +++ b/deps.bzl @@ -1037,6 +1037,19 @@ def go_dependencies(): sum = "h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk=", version = "v1.3.0", ) + go_repository( + name = "com_github_rs_xid", + importpath = "github.com/rs/xid", + sum = "h1:mhH9Nq+C1fY2l1XIpgxIiUOfNpRBYH1kKcr+qfKgjRc=", + version = "v1.2.1", + ) + go_repository( + name = "com_github_rs_zerolog", + importpath = "github.com/rs/zerolog", + sum = "h1:XrVUjV4K+izZpKXZHlPrYQiDtmdGiCylnT4i43AAWxg=", + version = "v1.22.0", + ) + go_repository( name = "com_github_russross_blackfriday_v2", importpath = "github.com/russross/blackfriday/v2", @@ -1205,6 +1218,13 @@ def go_dependencies(): sum = "h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=", version = "v0.0.0-20190116061207-43a291ad63a2", ) + go_repository( + name = "com_github_yuin_goldmark", + importpath = "github.com/yuin/goldmark", + sum = "h1:ruQGxdhGHe7FWOJPT0mKs5+pD2Xs1Bm/kdGlHO04FmM=", + version = "v1.2.1", + ) + go_repository( name = "com_google_cloud_go", importpath = "cloud.google.com/go", @@ -1490,14 +1510,14 @@ def go_dependencies(): go_repository( name = "org_golang_x_mod", importpath = "golang.org/x/mod", - sum = "h1:WG0RUwxtNT4qqaXX3DPA8zHFNm/D9xaBpxzHt1WcA/E=", - version = "v0.1.1-0.20191105210325-c90efee705ee", + sum = "h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=", + version = "v0.3.0", ) go_repository( name = "org_golang_x_net", importpath = "golang.org/x/net", - sum = "h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA=", - version = "v0.0.0-20200822124328-c89045814202", + sum = "h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI=", + version = "v0.0.0-20201021035429-f5854403a974", ) go_repository( name = "org_golang_x_oauth2", @@ -1520,8 +1540,8 @@ def go_dependencies(): go_repository( name = "org_golang_x_text", importpath = "golang.org/x/text", - sum = "h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=", - version = "v0.3.2", + sum = "h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=", + version = "v0.3.3", ) go_repository( name = "org_golang_x_time", @@ -1532,8 +1552,8 @@ def go_dependencies(): go_repository( name = "org_golang_x_tools", importpath = "golang.org/x/tools", - sum = "h1:DnSr2mCsxyCE6ZgIkmcWUQY2R5cH/6wL7eIxEmQOMSE=", - version = "v0.0.0-20200103221440-774c71fcf114", + sum = "h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY=", + version = "v0.1.0", ) go_repository( name = "org_golang_x_xerrors", diff --git a/go.mod b/go.mod index 7cacad4..385deb2 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.15 require ( github.com/gorilla/handlers v1.5.1 + github.com/rs/zerolog v1.22.0 github.com/spf13/cobra v1.1.3 github.com/spf13/viper v1.7.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0 diff --git a/go.sum b/go.sum index 12c2e2a..4a6b7a5 100644 --- a/go.sum +++ b/go.sum @@ -468,6 +468,10 @@ github.com/rogpeppe/fastuuid v1.2.0 h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rs/xid v1.2.1 h1:mhH9Nq+C1fY2l1XIpgxIiUOfNpRBYH1kKcr+qfKgjRc= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/zerolog v1.22.0 h1:XrVUjV4K+izZpKXZHlPrYQiDtmdGiCylnT4i43AAWxg= +github.com/rs/zerolog v1.22.0/go.mod h1:ZPhntP/xmq1nnND05hhpAh2QMhSsA4UN3MGZ6O2J3hM= github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f h1:UFr9zpz4xgTnIE5yIMtWAMngCdZ9p/+q6lTbgelo80M= @@ -531,6 +535,8 @@ github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/yuin/goldmark v1.2.1 h1:ruQGxdhGHe7FWOJPT0mKs5+pD2Xs1Bm/kdGlHO04FmM= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -609,8 +615,9 @@ golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee h1:WG0RUwxtNT4qqaXX3DPA8zHFNm/D9xaBpxzHt1WcA/E= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -630,8 +637,9 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -643,6 +651,7 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -668,13 +677,16 @@ golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 h1:46ULzRKLh1CwgRq2dC5SlBzEqqNCi8rreOZnNrbqcIY= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -701,8 +713,10 @@ golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114 h1:DnSr2mCsxyCE6ZgIkmcWUQY2R5cH/6wL7eIxEmQOMSE= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/pkg/echo/BUILD b/pkg/echo/BUILD index 5d4775e..eed67d2 100644 --- a/pkg/echo/BUILD +++ b/pkg/echo/BUILD @@ -5,4 +5,8 @@ go_library( srcs = ["echo.go"], importpath = "github.com/neticdk/jytte/pkg/echo", visibility = ["//visibility:public"], + deps = [ + "@com_github_rs_zerolog//log:go_default_library", + "@io_opentelemetry_go_otel_trace//:go_default_library", + ], ) diff --git a/pkg/echo/echo.go b/pkg/echo/echo.go index f2c2132..a20ed86 100644 --- a/pkg/echo/echo.go +++ b/pkg/echo/echo.go @@ -3,6 +3,10 @@ package echo import ( "net/http" + + "github.com/rs/zerolog/log" + + "go.opentelemetry.io/otel/trace" ) // Server is a handler implementation echoing back to the requestor @@ -16,5 +20,8 @@ func NewHandler() http.Handler { // ServeHTTP request func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request) { + span := trace.SpanFromContext(req.Context()) + log.Info().Str("TraceID", span.SpanContext().TraceID().String()).Msg("Echo service") + req.Write(w) } diff --git a/pkg/entropy/BUILD b/pkg/entropy/BUILD index 65cfdf2..27b0f09 100644 --- a/pkg/entropy/BUILD +++ b/pkg/entropy/BUILD @@ -6,6 +6,7 @@ go_library( importpath = "github.com/neticdk/jytte/pkg/entropy", visibility = ["//visibility:public"], deps = [ + "@com_github_rs_zerolog//log:go_default_library", "@io_opentelemetry_go_otel//:go_default_library", "@io_opentelemetry_go_otel//attribute:go_default_library", "@io_opentelemetry_go_otel//codes:go_default_library", diff --git a/pkg/entropy/entropy.go b/pkg/entropy/entropy.go index 64585cb..b26e9ed 100644 --- a/pkg/entropy/entropy.go +++ b/pkg/entropy/entropy.go @@ -7,6 +7,7 @@ import ( "net/http" "time" + "github.com/rs/zerolog/log" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" @@ -38,6 +39,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request) { req.Context(), "Call-Backend-Mock-Services", trace.WithAttributes(commonLabels...)) + log.Info().Str("TraceID", span.SpanContext().TraceID().String()).Msg("Entropy starting fan out") defer span.End() meter := global.GetMeterProvider().Meter("entropy") diff --git a/pkg/server/BUILD b/pkg/server/BUILD index 9e29c97..bac14d2 100644 --- a/pkg/server/BUILD +++ b/pkg/server/BUILD @@ -15,6 +15,7 @@ go_library( "//pkg/health:go_default_library", "//pkg/util:go_default_library", "@com_github_gorilla_handlers//:go_default_library", + "@com_github_rs_zerolog//log:go_default_library", "@io_opentelemetry_go_contrib_instrumentation_net_http_otelhttp//:go_default_library", "@io_opentelemetry_go_otel//:go_default_library", "@io_opentelemetry_go_otel//propagation:go_default_library", diff --git a/pkg/server/server.go b/pkg/server/server.go index 2ce21a5..7bd949d 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -2,7 +2,6 @@ package server import ( - "log" "net/http" "os" @@ -10,6 +9,7 @@ import ( "github.com/neticdk/jytte/pkg/echo" "github.com/neticdk/jytte/pkg/entropy" "github.com/neticdk/jytte/pkg/health" + "github.com/rs/zerolog/log" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" ) @@ -19,7 +19,7 @@ const ServiceName string = "jytte" // ListenAndServe instantiates a new server instance func ListenAndServe(listenAddr string, tracingEnabled bool, tracingAddr string) { if tracingEnabled { - log.Printf("Waiting for tracing connection...") + log.Info().Msg("Waiting for tracing connection to start up...") shutdown := initTracing(tracingAddr) defer shutdown() } @@ -30,6 +30,6 @@ func ListenAndServe(listenAddr string, tracingEnabled bool, tracingAddr string) http.Handle("/echo/", otelhttp.NewHandler(echo.NewHandler(), "echo")) http.Handle("/entropy/", otelhttp.NewHandler(entropy.NewHandler(), "")) - log.Printf("Start listening on %s", listenAddr) - log.Fatal(http.ListenAndServe(listenAddr, handlers.LoggingHandler(os.Stdout, http.DefaultServeMux))) + log.Info().Str("listenAddr", listenAddr).Msg("Start listening") + log.Fatal().Err(http.ListenAndServe(listenAddr, handlers.LoggingHandler(os.Stdout, http.DefaultServeMux))).Msg("Server failed") } diff --git a/pkg/server/tracing.go b/pkg/server/tracing.go index 9d6d1fa..bcf8038 100644 --- a/pkg/server/tracing.go +++ b/pkg/server/tracing.go @@ -2,10 +2,10 @@ package server import ( "context" - "log" "time" "github.com/neticdk/jytte/pkg/util" + "github.com/rs/zerolog/log" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/exporters/otlp" "go.opentelemetry.io/otel/exporters/otlp/otlpgrpc" @@ -21,7 +21,7 @@ import ( ) func initTracing(tracingAddr string) func() { - log.Printf("Sending traces to %s", tracingAddr) + log.Info().Str("tracingAddr", tracingAddr).Msg("Initialize tracing") ctx := context.Background() diff --git a/pkg/util/BUILD b/pkg/util/BUILD index 80e6619..075e6a8 100644 --- a/pkg/util/BUILD +++ b/pkg/util/BUILD @@ -5,4 +5,5 @@ go_library( srcs = ["util.go"], importpath = "github.com/neticdk/jytte/pkg/util", visibility = ["//visibility:public"], + deps = ["@com_github_rs_zerolog//log:go_default_library"], ) diff --git a/pkg/util/util.go b/pkg/util/util.go index 3a01246..6c16b51 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -1,12 +1,12 @@ package util import ( - "log" + "github.com/rs/zerolog/log" ) // HandleErr is a generic error handler func HandleErr(err error, message string) { if err != nil { - log.Fatalf("%s: %v", message, err) + log.Fatal().Err(err).Msg(message) } }