Skip to content

Commit

Permalink
bump: joonix/log to NewFormater() (#3342)
Browse files Browse the repository at this point in the history
* bump: joonix/log to NewFormater()

* remove joonix formatter for logrus FieldMap

* fix included timestamp format RFC3339Nano
  • Loading branch information
jonsch318 authored Aug 26, 2023
1 parent 176431c commit 4d116d7
Show file tree
Hide file tree
Showing 38 changed files with 1,470 additions and 337 deletions.
9 changes: 4 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,21 @@ require (
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2
github.com/hashicorp/golang-lru v0.5.1
github.com/heptiolabs/healthcheck v0.0.0-20171201210846-da5fdee475fb
github.com/joonix/log v0.0.0-20180502111528-d2d3f2f4a806
github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a
github.com/mennanov/fmutils v0.2.0
github.com/mitchellh/hashstructure/v2 v2.0.2
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.14.0
github.com/sirupsen/logrus v1.8.1
github.com/sirupsen/logrus v1.9.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.0
github.com/stretchr/testify v1.8.1
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802
go.opencensus.io v0.24.0
golang.org/x/net v0.8.0
golang.org/x/oauth2 v0.5.0
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8
golang.org/x/time v0.1.0
golang.org/x/tools v0.6.0
google.golang.org/api v0.110.0
google.golang.org/genproto v0.0.0-20230301171018-9ab4bdc49ad5
Expand All @@ -44,6 +43,7 @@ require (
k8s.io/apiextensions-apiserver v0.26.6
k8s.io/apimachinery v0.26.6
k8s.io/client-go v0.26.6
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280
k8s.io/utils v0.0.0-20221107191617-1a15be271d1d
)

Expand Down Expand Up @@ -88,7 +88,7 @@ require (
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/spf13/afero v1.2.2 // indirect
github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/cast v1.3.0 // indirect
github.com/spf13/jwalterweatherman v1.0.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
Expand All @@ -106,7 +106,6 @@ require (
k8s.io/gengo v0.0.0-20221011193443-fad74ee6edd9 // indirect
k8s.io/klog v1.0.0 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
Expand Down
75 changes: 66 additions & 9 deletions go.sum

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions pkg/util/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ package runtime

import (
"fmt"
"time"

gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
joonix "github.com/joonix/log"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"google.golang.org/protobuf/encoding/protojson"
Expand All @@ -36,7 +36,14 @@ type stackTracer interface {

// replace the standard glog error logger, with a logrus one
func init() {
logrus.SetFormatter(&joonix.FluentdFormatter{})
logrus.SetFormatter(&logrus.JSONFormatter{
TimestampFormat: time.RFC3339Nano,
FieldMap: logrus.FieldMap{
logrus.FieldKeyTime: "time",
logrus.FieldKeyLevel: "severity",
logrus.FieldKeyMsg: "message",
},
})

runtime.ErrorHandlers[0] = func(err error) {
if stackTrace, ok := err.(stackTracer); ok {
Expand Down
21 changes: 0 additions & 21 deletions vendor/github.com/joonix/log/LICENSE

This file was deleted.

36 changes: 0 additions & 36 deletions vendor/github.com/joonix/log/README.md

This file was deleted.

60 changes: 0 additions & 60 deletions vendor/github.com/joonix/log/fluentd.go

This file was deleted.

4 changes: 2 additions & 2 deletions vendor/github.com/sirupsen/logrus/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions vendor/github.com/sirupsen/logrus/buffer_pool.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 16 additions & 5 deletions vendor/github.com/sirupsen/logrus/entry.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions vendor/github.com/sirupsen/logrus/logger.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions vendor/github.com/spf13/afero/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4d116d7

Please sign in to comment.