Skip to content

Commit

Permalink
remove logging json option, bumped to new logging fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jubeless committed Apr 21, 2024
1 parent 0205920 commit 9c9304d
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions cmd/substreams-sink-kv/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ func main() {
}

func preStart(_ *cobra.Command, _ []string) error {
logging.InstantiateLoggers(loggingOptions(viper.GetString("global-log-format"))...)
logging.InstantiateLoggers(
logging.WithLogLevelSwitcherServerAutoStart(),
logging.WithDefaultLevel(zap.InfoLevel),
logging.WithConsoleToStderr(),
)

delay := viper.GetDuration("global-delay-before-start")
if delay > 0 {
Expand All @@ -67,17 +71,3 @@ func preStart(_ *cobra.Command, _ []string) error {

return nil
}

func loggingOptions(logFormat string) []logging.InstantiateOption {
options := []logging.InstantiateOption{
logging.WithLogLevelSwitcherServerAutoStart(),
logging.WithDefaultLevel(zap.InfoLevel),
logging.WithConsoleToStderr(),
}

if logFormat == "stackdriver" || logFormat == "json" {
options = append(options, logging.WithProductionLogger())
}

return options
}

0 comments on commit 9c9304d

Please sign in to comment.