Skip to content

Commit

Permalink
fix: change to use logrus rather than zap
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed Jul 19, 2021
1 parent 908155d commit 2c3e65f
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 2 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## v0.0.68 (2021-07-16)

* [6f3cc61](https://github.com/argoproj-labs/argo-dataflow/commit/6f3cc61fda2938432317606ea168d505225b29d7) feat: support configurable Kafka starting offset
* [4cdf4bb](https://github.com/argoproj-labs/argo-dataflow/commit/4cdf4bb117833fee39872b3740053a91e32ab038) fix: Kafka should start at LastOffset by default
* [af46d66](https://github.com/argoproj-labs/argo-dataflow/commit/af46d66cc6a09b4d1286b06aad714c8c731aa63e) fix: correct source hook to be pre-stop hook
* [5544da5](https://github.com/argoproj-labs/argo-dataflow/commit/5544da5a08e64e92f9b68bf02666de506f3175fc) refactor: refactor sources
* [4398de4](https://github.com/argoproj-labs/argo-dataflow/commit/4398de44ae42d51607b74f9fa432ba938a50b98d) feat: expose maxInflight for stan config (#117)
* [51c21ad](https://github.com/argoproj-labs/argo-dataflow/commit/51c21add95e2176c33016066101ebb57adbd3426) feat: Partially migrate from sarama to kafka-go (#116)
* [39cd13a](https://github.com/argoproj-labs/argo-dataflow/commit/39cd13afff9d5aa460c6411cca6035a97cbf566c) feat: make Kafka commitN configurable. Fixes #114

### Contributors

* Alex Collins
* Derek Wang

## v0.0.67 (2021-07-15)

* [573b31c](https://github.com/argoproj-labs/argo-dataflow/commit/573b31c50db92c85aad9fbf640a79bbfb67410cd) feat: stan reliable auto reconnection (#112)
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (
github.com/Masterminds/sprig v2.22.0+incompatible
github.com/Shopify/sarama v1.29.1
github.com/antonmedv/expr v1.8.9
github.com/bombsimon/logrusr v1.1.0
github.com/doublerebel/bellows v0.0.0-20160303004610-f177d92a03d3
github.com/evanphx/json-patch v4.9.0+incompatible
github.com/go-git/go-git/v5 v5.3.0
Expand All @@ -33,6 +34,7 @@ require (
github.com/prometheus/common v0.10.0
github.com/robfig/cron/v3 v3.0.0
github.com/segmentio/kafka-go v0.4.17
github.com/sirupsen/logrus v1.6.0
github.com/stretchr/testify v1.7.0
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
github.com/bombsimon/logrusr v1.1.0 h1:Y03FI4Z/Shyrc9jF26vuaUbnPxC5NMJnTtJA/3Lihq8=
github.com/bombsimon/logrusr v1.1.0/go.mod h1:Jq0nHtvxabKE5EMwAAdgTaz7dfWE8C4i11NOltxGQpc=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
Expand Down Expand Up @@ -356,6 +358,8 @@ github.com/klauspost/compress v1.12.2/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8
github.com/klauspost/compress v1.13.1 h1:wXr2uRxZTJXHLly6qhJabee5JqIhTRoLBhDOA74hDEQ=
github.com/klauspost/compress v1.13.1/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
Expand Down Expand Up @@ -504,6 +508,7 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
Expand Down Expand Up @@ -699,6 +704,7 @@ golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down
8 changes: 6 additions & 2 deletions shared/util/log.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package util

import (
"github.com/bombsimon/logrusr"
"github.com/go-logr/logr"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
"github.com/sirupsen/logrus"
"os"
)

func NewLogger() logr.Logger {
return zap.New()
l := logrus.New()
l.SetOutput(os.Stdout)
return logrusr.NewLogger(l)
}
9 changes: 9 additions & 0 deletions shared/util/log_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package util

import (
"testing"
)

func TestNewLogger(t *testing.T) {
NewLogger().Info("test", "a", 1, "b", "c")
}

0 comments on commit 2c3e65f

Please sign in to comment.