From b006f78258a82a07d28cf55734cbb2ed1bb91431 Mon Sep 17 00:00:00 2001 From: Paul Lorenz Date: Fri, 16 Jul 2021 13:57:04 -0400 Subject: [PATCH] Update pfxlog to 0.5.1 --- go.mod | 10 ++++---- go.sum | 29 +++++++++++----------- ziti-controller/main.go | 4 +-- ziti-controller/subcmd/root.go | 2 +- ziti-fabric-gw/main.go | 4 +-- ziti-fabric-test/main.go | 4 +-- ziti-fabric/main.go | 4 +-- ziti-probe/subcmd/root.go | 2 +- ziti-probe/ziti-probe.go | 4 +-- ziti-router/main.go | 4 +-- ziti-router/subcmd/root.go | 2 +- ziti-tunnel/cmd/ziti-tunnel/main.go | 4 +-- ziti-tunnel/cmd/ziti-tunnel/subcmd/root.go | 2 +- ziti/cmd/ziti/cmd/log_filter.go | 8 ++++-- 14 files changed, 37 insertions(+), 46 deletions(-) diff --git a/go.mod b/go.mod index 399db10e3..3f2ff3698 100644 --- a/go.mod +++ b/go.mod @@ -28,11 +28,11 @@ require ( github.com/gorilla/mux v1.8.0 github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d github.com/keybase/go-ps v0.0.0-20190827175125-91aafc93ba19 - github.com/michaelquigley/pfxlog v0.3.7 - github.com/openziti/edge v0.19.164 - github.com/openziti/fabric v0.16.76 - github.com/openziti/foundation v0.15.60 - github.com/openziti/sdk-golang v0.15.65 + github.com/michaelquigley/pfxlog v0.5.1 + github.com/openziti/edge v0.19.166 + github.com/openziti/fabric v0.16.78 + github.com/openziti/foundation v0.15.62 + github.com/openziti/sdk-golang v0.15.66 github.com/pborman/uuid v1.2.0 github.com/pkg/errors v0.9.1 github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 diff --git a/go.sum b/go.sum index 53bf6701a..eda759550 100644 --- a/go.sum +++ b/go.sum @@ -412,8 +412,8 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4 github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -605,8 +605,8 @@ github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyex github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/michaelquigley/pfxlog v0.3.1/go.mod h1:pwJmJ9nN787xk9U+0z8/5nP2GMhU6GGCTfgBWGpiXaQ= -github.com/michaelquigley/pfxlog v0.3.7 h1:itV+da+Kek0GwApI2vOcGhLdMk6eCNfjXoR6/Pezo+k= -github.com/michaelquigley/pfxlog v0.3.7/go.mod h1:s4uqqB54PDLSU6JvpizMBJ2VU4cpG3bXsXJvFHqHDLU= +github.com/michaelquigley/pfxlog v0.5.1 h1:J+s/OyZSlvVncPvTyrkasLpAPgOxp0bvICiMPKI4KsY= +github.com/michaelquigley/pfxlog v0.5.1/go.mod h1:z864Y2uU0O4QA5OoclXIOdoX5Tme2zm66FLAJ+R1jZs= github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.31/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= @@ -673,14 +673,14 @@ github.com/openziti/bbolt v1.3.6-0.20210317142109-547da822475e h1:ST9+54UtCr96S5 github.com/openziti/bbolt v1.3.6-0.20210317142109-547da822475e/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= github.com/openziti/dilithium v0.3.3 h1:PLgQ6PMNLSTzCFbX/h98cmudgz/cU6TmjdSv5NAPD8k= github.com/openziti/dilithium v0.3.3/go.mod h1:vsCjI2AU/hon9e+dLhUFbCNGesJDj2ASgkySOcpmvjo= -github.com/openziti/edge v0.19.164 h1:uzwK6oXaTLkC1Y7rN/PT+T8aRi7vpaH3WLQhdAvP+GQ= -github.com/openziti/edge v0.19.164/go.mod h1:F44WyOfjUX3FLQwnv+fpRP+V/+dj6habRB7x/0kwCCo= -github.com/openziti/fabric v0.16.76 h1:npVqw6d1mAV7cNjFkmObZfX15fInSaWrMV0yVjLucsw= -github.com/openziti/fabric v0.16.76/go.mod h1:/YJY1j2RTx2gMBL7oQG06BQk5eD8QfN0SimbKjFKvRI= -github.com/openziti/foundation v0.15.60 h1:RkVyq0H0w+G2mA5+20xoodULNwn67QQPYDPzyMqpf6M= -github.com/openziti/foundation v0.15.60/go.mod h1:T6AFkhKlyuH+zsM5AChqoxl45cBswx70mw288eVy4lY= -github.com/openziti/sdk-golang v0.15.65 h1:GleTldLmKrafDX36hZNIqP+VORUiHx+HUZgKWtgKN4o= -github.com/openziti/sdk-golang v0.15.65/go.mod h1:8LZFzi4hl4tfFoBDDIhYLA07wR7ZdKYFWtMRuY6nk2g= +github.com/openziti/edge v0.19.166 h1:gLBfpSvy7t9vUkWTvcF10q9igAXPioW3IpwfA2Rpj1Q= +github.com/openziti/edge v0.19.166/go.mod h1:C2k0vPxAXVHdMlfQJ/nCQ0yAsld1hSkqW33ygOKDSaM= +github.com/openziti/fabric v0.16.78 h1:x76HTlxHYiCjNqtNJZhkWSF07LAr8N9N+PvbOFRow+0= +github.com/openziti/fabric v0.16.78/go.mod h1:gXK+lmCt4LmEef+p4ipeJCQ9m+veCi2Psnhf2jvuIsQ= +github.com/openziti/foundation v0.15.62 h1:xXl/2xNLgFnpKaxhpM3PQVOEff5ONO6Dvhs+/6wUJYk= +github.com/openziti/foundation v0.15.62/go.mod h1:P7c2y/OMTeDDB90HAuzAM6P7ElRfZm47a3e0rE+UBQs= +github.com/openziti/sdk-golang v0.15.66 h1:NDGjYgZpFxKHZxTDBlIUugzjgd1h3143Ik43VhoebK4= +github.com/openziti/sdk-golang v0.15.66/go.mod h1:OydixHIFXgIT05QrbMSvIm6GScwWN7lLr4on5TirIjM= github.com/oracle/oci-go-sdk v24.2.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888= github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= github.com/orcaman/concurrent-map v0.0.0-20210106121528-16402b402231 h1:fa50YL1pzKW+1SsBnJDOHppJN9stOEwS+CRWyUtyYGU= @@ -800,7 +800,6 @@ github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= @@ -922,8 +921,9 @@ golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e h1:gsTQYXdTw2Gq7RBsWvlQ91b+aEQ6bXFUngBGuR8sPpI= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1131,6 +1131,7 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/ziti-controller/main.go b/ziti-controller/main.go index 7eb8ff787..6082cc6a4 100644 --- a/ziti-controller/main.go +++ b/ziti-controller/main.go @@ -32,9 +32,7 @@ import ( ) func init() { - pfxlog.Global(logrus.InfoLevel) - pfxlog.SetPrefix("github.com/openziti/") - pfxlog.SetDefaultNoColor() + pfxlog.GlobalInit(logrus.InfoLevel, pfxlog.DefaultOptions().SetTrimPrefix("github.com/openziti/").NoColor()) transport.AddAddressParser(quic.AddressParser{}) transport.AddAddressParser(tls.AddressParser{}) transport.AddAddressParser(tcp.AddressParser{}) diff --git a/ziti-controller/subcmd/root.go b/ziti-controller/subcmd/root.go index d902305e3..9fb807835 100644 --- a/ziti-controller/subcmd/root.go +++ b/ziti-controller/subcmd/root.go @@ -44,7 +44,7 @@ var root = &cobra.Command{ switch logFormatter { case "pfxlog": - logrus.SetFormatter(pfxlog.NewFormatterStartingToday()) + logrus.SetFormatter(pfxlog.NewFormatter(pfxlog.DefaultOptions().StartingToday())) case "json": logrus.SetFormatter(&logrus.JSONFormatter{TimestampFormat: "2006-01-02T15:04:05.000Z"}) case "text": diff --git a/ziti-fabric-gw/main.go b/ziti-fabric-gw/main.go index 13440b751..e4217ed16 100644 --- a/ziti-fabric-gw/main.go +++ b/ziti-fabric-gw/main.go @@ -30,9 +30,7 @@ import ( ) func init() { - pfxlog.Global(logrus.InfoLevel) - pfxlog.SetPrefix("github.com/openziti/") - pfxlog.SetDefaultNoColor() + pfxlog.GlobalInit(logrus.InfoLevel, pfxlog.DefaultOptions().SetTrimPrefix("github.com/openziti/").NoColor()) transport.AddAddressParser(quic.AddressParser{}) transport.AddAddressParser(tls.AddressParser{}) transport.AddAddressParser(tcp.AddressParser{}) diff --git a/ziti-fabric-test/main.go b/ziti-fabric-test/main.go index 3943f0c17..7b68093f3 100644 --- a/ziti-fabric-test/main.go +++ b/ziti-fabric-test/main.go @@ -35,9 +35,7 @@ import ( ) func init() { - pfxlog.Global(logrus.InfoLevel) - pfxlog.SetPrefix("github.com/openziti/") - pfxlog.SetDefaultNoColor() + pfxlog.GlobalInit(logrus.InfoLevel, pfxlog.DefaultOptions().SetTrimPrefix("github.com/openziti/").NoColor()) transport.AddAddressParser(quic.AddressParser{}) transport.AddAddressParser(tls.AddressParser{}) transport.AddAddressParser(tcp.AddressParser{}) diff --git a/ziti-fabric/main.go b/ziti-fabric/main.go index 6f9e3c822..2f0c1f027 100644 --- a/ziti-fabric/main.go +++ b/ziti-fabric/main.go @@ -31,9 +31,7 @@ import ( ) func init() { - pfxlog.Global(logrus.InfoLevel) - pfxlog.SetPrefix("github.com/openziti/") - pfxlog.SetDefaultNoColor() + pfxlog.GlobalInit(logrus.InfoLevel, pfxlog.DefaultOptions().SetTrimPrefix("github.com/openziti/").NoColor()) transport.AddAddressParser(quic.AddressParser{}) transport.AddAddressParser(tls.AddressParser{}) transport.AddAddressParser(tcp.AddressParser{}) diff --git a/ziti-probe/subcmd/root.go b/ziti-probe/subcmd/root.go index 5e28c439b..9ba23724b 100644 --- a/ziti-probe/subcmd/root.go +++ b/ziti-probe/subcmd/root.go @@ -41,7 +41,7 @@ var root = &cobra.Command{ switch logFormatter { case "pfxlog": - logrus.SetFormatter(pfxlog.NewFormatterStartingToday()) + logrus.SetFormatter(pfxlog.NewFormatter(pfxlog.DefaultOptions().StartingToday())) case "json": logrus.SetFormatter(&logrus.JSONFormatter{TimestampFormat: "2006-01-02T15:04:05.000Z"}) case "text": diff --git a/ziti-probe/ziti-probe.go b/ziti-probe/ziti-probe.go index b7d5d1c97..31c9a8350 100644 --- a/ziti-probe/ziti-probe.go +++ b/ziti-probe/ziti-probe.go @@ -8,9 +8,7 @@ import ( ) func init() { - pfxlog.Global(logrus.InfoLevel) - pfxlog.SetPrefix("github.com/openziti/") - pfxlog.SetDefaultNoColor() + pfxlog.GlobalInit(logrus.InfoLevel, pfxlog.DefaultOptions().SetTrimPrefix("github.com/openziti/").NoColor()) } func main() { diff --git a/ziti-router/main.go b/ziti-router/main.go index d4f4e4f00..2ab1d6229 100644 --- a/ziti-router/main.go +++ b/ziti-router/main.go @@ -33,9 +33,7 @@ import ( ) func init() { - pfxlog.Global(logrus.InfoLevel) - pfxlog.SetPrefix("github.com/openziti/") - pfxlog.SetDefaultNoColor() + pfxlog.GlobalInit(logrus.InfoLevel, pfxlog.DefaultOptions().SetTrimPrefix("github.com/openziti/").NoColor()) transport.AddAddressParser(quic.AddressParser{}) transport.AddAddressParser(tls.AddressParser{}) transport.AddAddressParser(tcp.AddressParser{}) diff --git a/ziti-router/subcmd/root.go b/ziti-router/subcmd/root.go index 588ff25cf..9e1330071 100644 --- a/ziti-router/subcmd/root.go +++ b/ziti-router/subcmd/root.go @@ -41,7 +41,7 @@ var root = &cobra.Command{ switch logFormatter { case "pfxlog": - logrus.SetFormatter(pfxlog.NewFormatterStartingToday()) + logrus.SetFormatter(pfxlog.NewFormatter(pfxlog.DefaultOptions().StartingToday())) case "json": logrus.SetFormatter(&logrus.JSONFormatter{TimestampFormat: "2006-01-02T15:04:05.000Z"}) case "text": diff --git a/ziti-tunnel/cmd/ziti-tunnel/main.go b/ziti-tunnel/cmd/ziti-tunnel/main.go index 1a6b42f94..547679b83 100644 --- a/ziti-tunnel/cmd/ziti-tunnel/main.go +++ b/ziti-tunnel/cmd/ziti-tunnel/main.go @@ -24,9 +24,7 @@ import ( ) func init() { - pfxlog.Global(logrus.InfoLevel) - pfxlog.SetPrefix("github.com/openziti/") - pfxlog.SetDefaultNoColor() + pfxlog.GlobalInit(logrus.InfoLevel, pfxlog.DefaultOptions().SetTrimPrefix("github.com/openziti/").NoColor()) } func main() { diff --git a/ziti-tunnel/cmd/ziti-tunnel/subcmd/root.go b/ziti-tunnel/cmd/ziti-tunnel/subcmd/root.go index b9ce2d8b3..c9e21d834 100644 --- a/ziti-tunnel/cmd/ziti-tunnel/subcmd/root.go +++ b/ziti-tunnel/cmd/ziti-tunnel/subcmd/root.go @@ -82,7 +82,7 @@ func rootPreRun(cmd *cobra.Command, _ []string) { switch logFormatter { case "pfxlog": - logrus.SetFormatter(pfxlog.NewFormatterStartingToday()) + logrus.SetFormatter(pfxlog.NewFormatter(pfxlog.DefaultOptions().StartingToday())) case "json": logrus.SetFormatter(&logrus.JSONFormatter{TimestampFormat: "2006-01-02T15:04:05.000Z"}) case "text": diff --git a/ziti/cmd/ziti/cmd/log_filter.go b/ziti/cmd/ziti/cmd/log_filter.go index 3d857c224..41d26e431 100644 --- a/ziti/cmd/ziti/cmd/log_filter.go +++ b/ziti/cmd/ziti/cmd/log_filter.go @@ -17,7 +17,7 @@ package cmd import ( - "github.com/michaelquigley/pfxlog/filter" + "github.com/michaelquigley/pfxlog" cmdutil "github.com/openziti/ziti/ziti/cmd/ziti/cmd/factory" cmdhelper "github.com/openziti/ziti/ziti/cmd/ziti/cmd/helpers" "github.com/spf13/cobra" @@ -62,6 +62,10 @@ func NewCmdLogFormat(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra. // Run implements this command func (o *LogFormatOptions) Run() error { - filter.Filter(o.absoluteTime, o.trimPrefix) + options := pfxlog.DefaultOptions().SetTrimPrefix(o.trimPrefix) + if o.absoluteTime { + options.SetAbsoluteTime() + } + pfxlog.Filter(options) return nil }