Use github.com/rs/zerolog for logging (#1255)

* Use `github.com/rs/zerolog` for logging

* Use `github.com/rs/zerolog` for logging (continue)

* Add `debug` flag

* Remove `github.com/op/go-logging` dependency completely

* Fix linter
This commit is contained in:
M. Mert Yildiran
2022-11-28 16:48:20 -08:00
committed by GitHub
parent 10a9b5a3d7
commit 86fd616b84
36 changed files with 511 additions and 318 deletions

View File

@@ -2,12 +2,12 @@ package cmd
import (
"errors"
"log"
"github.com/creasty/defaults"
"github.com/kubeshark/kubeshark/config"
"github.com/kubeshark/kubeshark/config/configStructs"
"github.com/kubeshark/kubeshark/errormessage"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
)
@@ -31,7 +31,9 @@ Supported protocols are HTTP and gRPC.`,
return errormessage.FormatError(err)
}
log.Printf("Kubeshark will store up to %s of traffic, old traffic will be cleared once the limit is reached.", config.Config.Tap.HumanMaxEntriesDBSize)
log.Info().
Str("limit", config.Config.Tap.HumanMaxEntriesDBSize).
Msg("Kubeshark will store traffic up to a limit. The old traffic will be cleared once the limit is reached.")
return nil
},
@@ -42,7 +44,7 @@ func init() {
defaultTapConfig := configStructs.TapConfig{}
if err := defaults.Set(&defaultTapConfig); err != nil {
log.Print(err)
log.Debug().Err(err)
}
tapCmd.Flags().Uint16P(configStructs.GuiPortTapName, "p", defaultTapConfig.GuiPort, "Provide a custom port for the web interface webserver")