cmd: add log message for rollbar token

This commit is contained in:
c9s 2022-12-12 17:37:40 +08:00
parent c8098b414b
commit d83feec9ec
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -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,
))
}