From e8ff1783fa4ad29cbf58ce9a14a27f11153b73af Mon Sep 17 00:00:00 2001 From: Alex Mackay <52156545+ATMackay@users.noreply.github.com> Date: Thu, 4 Apr 2024 09:25:45 +0100 Subject: [PATCH] fix(log): ETH-1685 simple logrus fix (#3) * fix: ETH-1685 simple logrus fix * update dependency --- go.mod | 2 +- go.sum | 4 ++-- log/logger.go | 9 +++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 0c7934f..ffaf5df 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/prometheus/client_golang v1.14.0 github.com/protolambda/zrnt v0.28.0 github.com/protolambda/ztyp v0.2.2 - github.com/sirupsen/logrus v1.9.0 + github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.15.0 diff --git a/go.sum b/go.sum index d105ecb..be806c9 100644 --- a/go.sum +++ b/go.sum @@ -459,8 +459,8 @@ github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMT github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= 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.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.9.4 h1:Sd43wM1IWz/s1aVXdOBkjJvuP8UdyqioeE4AmM0QsBs= github.com/spf13/afero v1.9.4/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= diff --git a/log/logger.go b/log/logger.go index b6f96b7..2eb9832 100644 --- a/log/logger.go +++ b/log/logger.go @@ -23,8 +23,9 @@ func New(cfg *Config) (*logrus.Logger, error) { return nil, err } - return &logrus.Logger{ - Formatter: formatter, - Level: level, - }, nil + l := logrus.New() + l.SetFormatter(formatter) + l.SetLevel(level) + + return l, nil }