bbgo: remove slack debug option

This commit is contained in:
c9s 2022-04-25 18:56:19 +08:00
parent 638d839975
commit 2732fb413f
No known key found for this signature in database
GPG Key ID: F0A7E4490F2EBC8C
2 changed files with 9 additions and 4 deletions

View File

@ -878,10 +878,16 @@ func (environ *Environment) setupSlack(userConfig *Config, slackToken string, pe
log.Debugf("adding slack notifier with default channel: %s", conf.DefaultChannel)
var client = slack.New(slackToken,
slack.OptionDebug(true),
var slackOpts = []slack.Option{
slack.OptionLog(stdlog.New(os.Stdout, "api: ", stdlog.Lshortfile|stdlog.LstdFlags)),
slack.OptionAppLevelToken(slackAppToken))
slack.OptionAppLevelToken(slackAppToken),
}
if b, ok := util.GetEnvVarBool("DEBUG_SLACK"); ok {
slackOpts = append(slackOpts, slack.OptionDebug(b))
}
var client = slack.New(slackToken, slackOpts...)
var notifier = slacknotifier.New(client, conf.DefaultChannel)
environ.AddNotifier(notifier)

View File

@ -34,7 +34,6 @@ type Notifier struct {
type NotifyOption func(notifier *Notifier)
func New(client *slack.Client, channel string, options ...NotifyOption) *Notifier {
// var client = slack.New(token, slack.OptionDebug(true))
notifier := &Notifier{
channel: channel,
client: client,