Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump: joonix/log to NewFormater() #3342

Merged
merged 7 commits into from
Aug 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep the time format the same as before

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
Loading