From d83feec9ecedcb5a3ee3879aedb67b3de0cd04b3 Mon Sep 17 00:00:00 2001 From: c9s Date: Mon, 12 Dec 2022 17:37:40 +0800 Subject: [PATCH] cmd: add log message for rollbar token --- pkg/cmd/root.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/root.go b/pkg/cmd/root.go index 5dbf6cb28..b15684262 100644 --- a/pkg/cmd/root.go +++ b/pkg/cmd/root.go @@ -20,6 +20,7 @@ import ( "github.com/x-cray/logrus-prefixed-formatter" "github.com/c9s/bbgo/pkg/bbgo" + "github.com/c9s/bbgo/pkg/util" _ "github.com/go-sql-driver/mysql" ) @@ -50,9 +51,11 @@ var RootCmd = &cobra.Command{ env = "development" } - if viper.GetString("rollbar-token") != "" { + if token := viper.GetString("rollbar-token"); token != "" { + log.Infof("found rollbar token %q, setting up rollbar hook...", util.MaskKey(token)) + log.AddHook(rollrus.NewHook( - viper.GetString("rollbar-token"), + token, env, )) }