From c9a51883056983ff7088c683927dbfa4187839e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Jun 2022 11:07:28 +0000 Subject: [PATCH] chore(deps): bump github.com/obalunenko/logger from 0.2.0 to 0.4.0 Bumps [github.com/obalunenko/logger](https://github.com/obalunenko/logger) from 0.2.0 to 0.4.0. - [Release notes](https://github.com/obalunenko/logger/releases) - [Changelog](https://github.com/obalunenko/logger/blob/master/.goreleaser.yml) - [Commits](https://github.com/obalunenko/logger/compare/v0.2.0...v0.4.0) --- updated-dependencies: - dependency-name: github.com/obalunenko/logger dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 +- .../github.com/obalunenko/logger/formatter.go | 41 ++++++------------- vendor/github.com/obalunenko/logger/level.go | 15 +++++++ vendor/github.com/obalunenko/logger/logger.go | 5 +++ vendor/modules.txt | 2 +- 6 files changed, 37 insertions(+), 32 deletions(-) create mode 100644 vendor/github.com/obalunenko/logger/level.go diff --git a/go.mod b/go.mod index 66ba04e1..0fcff445 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/briandowns/spinner v1.18.1 github.com/manifoldco/promptui v0.9.0 github.com/obalunenko/getenv v1.0.0 - github.com/obalunenko/logger v0.2.0 + github.com/obalunenko/logger v0.4.0 github.com/obalunenko/version v1.1.0 github.com/stretchr/testify v1.7.2 github.com/urfave/cli/v2 v2.8.1 diff --git a/go.sum b/go.sum index 0eb894cc..1f263860 100644 --- a/go.sum +++ b/go.sum @@ -27,8 +27,8 @@ github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/obalunenko/getenv v1.0.0 h1:zYaUeRalCYXs2Jlk6eaz+MedWgA0L5VQTcAC5mDhFvU= github.com/obalunenko/getenv v1.0.0/go.mod h1:xXXx25+fQ7SGRkrLwTqCfZ96XAJQGtGZb16j3Qd0Ues= -github.com/obalunenko/logger v0.2.0 h1:g1CbCK9wB8Q66NMuiroYt4nGFvvOFneMd37olUTADng= -github.com/obalunenko/logger v0.2.0/go.mod h1:18AGelpMPZ7R+mLv0fxfP5G/ettnNFoU47B+azlE/iw= +github.com/obalunenko/logger v0.4.0 h1:C4PlzRhKSLCNx74eQ9BFVBLJIIbOt0kTWAGagMXa7vs= +github.com/obalunenko/logger v0.4.0/go.mod h1:18AGelpMPZ7R+mLv0fxfP5G/ettnNFoU47B+azlE/iw= github.com/obalunenko/version v1.1.0 h1:yVua7OHnK3+MJpendeMmAlfzVmq7R1h8MO3Ufz7HEec= github.com/obalunenko/version v1.1.0/go.mod h1:Or267aCQxNcAtgOeWA7yOe/RqJS4XDaMfcFwk3ohbOg= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= diff --git a/vendor/github.com/obalunenko/logger/formatter.go b/vendor/github.com/obalunenko/logger/formatter.go index 8883ab4a..aad6b412 100644 --- a/vendor/github.com/obalunenko/logger/formatter.go +++ b/vendor/github.com/obalunenko/logger/formatter.go @@ -27,37 +27,22 @@ func makeFormatter(format string) logrus.Formatter { } func jsonFormatter() logrus.Formatter { - f := logrus.JSONFormatter{ - TimestampFormat: time.RFC3339Nano, - DisableTimestamp: false, - DisableHTMLEscape: false, - DataKey: "metadata", - FieldMap: nil, - CallerPrettyfier: nil, - PrettyPrint: false, - } + f := new(logrus.JSONFormatter) + f.TimestampFormat = time.RFC3339Nano + + f.DataKey = "metadata" - return &f + return f } func textFormatter() logrus.Formatter { - f := logrus.TextFormatter{ - ForceColors: false, - DisableColors: false, - ForceQuote: false, - DisableQuote: false, - EnvironmentOverrideColors: false, - DisableTimestamp: false, - FullTimestamp: true, - TimestampFormat: "02-01-2006 15:04:05", - DisableSorting: false, - SortingFunc: nil, - DisableLevelTruncation: false, - PadLevelText: false, - QuoteEmptyFields: true, - FieldMap: nil, - CallerPrettyfier: nil, - } + f := new(logrus.TextFormatter) + + f.ForceColors = true + f.DisableColors = false + f.FullTimestamp = true + f.TimestampFormat = "02-01-2006 15:04:05" + f.QuoteEmptyFields = true - return &f + return f } diff --git a/vendor/github.com/obalunenko/logger/level.go b/vendor/github.com/obalunenko/logger/level.go new file mode 100644 index 00000000..ed110c50 --- /dev/null +++ b/vendor/github.com/obalunenko/logger/level.go @@ -0,0 +1,15 @@ +package logger + +import ( + "github.com/sirupsen/logrus" +) + +// Level type. +type Level struct { + logrus.Level +} + +// IsDebug checks if level is in debug range. +func (l Level) IsDebug() bool { + return l.Level >= logrus.DebugLevel +} diff --git a/vendor/github.com/obalunenko/logger/logger.go b/vendor/github.com/obalunenko/logger/logger.go index eef66d4f..4f37181d 100644 --- a/vendor/github.com/obalunenko/logger/logger.go +++ b/vendor/github.com/obalunenko/logger/logger.go @@ -43,12 +43,17 @@ type Logger interface { WithFields(fields Fields) Logger Writer() io.WriteCloser + LogLevel() Level } type logrusWrapper struct { le *logrus.Entry } +func (l logrusWrapper) LogLevel() Level { + return Level{Level: l.le.Level} +} + func (l logrusWrapper) Debug(msg string) { l.le.Debug(msg) } diff --git a/vendor/modules.txt b/vendor/modules.txt index aad7fa3c..fb98dfa4 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -36,7 +36,7 @@ github.com/mattn/go-isatty # github.com/obalunenko/getenv v1.0.0 ## explicit; go 1.17 github.com/obalunenko/getenv -# github.com/obalunenko/logger v0.2.0 +# github.com/obalunenko/logger v0.4.0 ## explicit; go 1.18 github.com/obalunenko/logger # github.com/obalunenko/version v1.1.0