diff --git a/cmd/coraza-spoa/main.go b/cmd/coraza-spoa/main.go index 49d369f..e1583a8 100644 --- a/cmd/coraza-spoa/main.go +++ b/cmd/coraza-spoa/main.go @@ -13,6 +13,7 @@ import ( func main() { cfg := flag.String("config", "", "configuration file") + //nolint:staticcheck // That's exactly nil check if cfg == nil { log.Fatal().Msg("configuration file is not set") } @@ -22,6 +23,7 @@ func main() { log.SetDebug(*debug) + //nolint:staticcheck // Nil is checked above if err := config.InitConfig(*cfg); err != nil { log.Fatal().Err(err).Msg("Can't initialize configuration") } diff --git a/go.mod b/go.mod index ed9195a..9755875 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( github.com/criteo/haproxy-spoe-go v1.0.6 github.com/magefile/mage v1.15.0 github.com/rs/zerolog v1.29.1 + github.com/sirupsen/logrus v1.9.3 gopkg.in/yaml.v3 v3.0.1 ) @@ -17,7 +18,6 @@ require ( github.com/mattn/go-isatty v0.0.14 // indirect github.com/petar-dambovaliev/aho-corasick v0.0.0-20211021192214-5ab2d9280aa9 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/sirupsen/logrus v1.9.3 // indirect github.com/stretchr/testify v1.8.0 // indirect github.com/tidwall/gjson v1.14.4 // indirect github.com/tidwall/match v1.1.1 // indirect diff --git a/log/log.go b/log/log.go index e303ba3..2716875 100644 --- a/log/log.go +++ b/log/log.go @@ -21,10 +21,10 @@ var WafErrorCallback = func(mr types.MatchedRule) { } // InitLogging initializes the logging. -func InitLogging(file, level, spoeLevel string) error { +func InitLogging(file, level, spoeLevel string) { if level == "" && file == "" { Debug().Msg("Nothing to configure, using standard logger") - return nil + return } logger := Logger @@ -60,8 +60,6 @@ func InitLogging(file, level, spoeLevel string) error { Debug().Msgf("Setting up %v SPOE log level", targetSpoeLevel) spoelog.SetLevel(targetSpoeLevel) } - - return nil } func SetDebug(debug bool) {