Skip to content

Commit

Permalink
Merge pull request #756 from ersonp/remove-discord-hook
Browse files Browse the repository at this point in the history
Remove discord
  • Loading branch information
jdknives authored May 5, 2021
2 parents b6d833e + cf557c1 commit bc08494
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 31 deletions.
14 changes: 0 additions & 14 deletions cmd/setup-node/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/sirupsen/logrus"
"github.com/skycoin/dmsg/buildinfo"
"github.com/skycoin/dmsg/cmdutil"
"github.com/skycoin/dmsg/discord"
"github.com/skycoin/dmsg/metricsutil"
"github.com/skycoin/skycoin/src/util/logging"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -55,19 +54,6 @@ var rootCmd = &cobra.Command{
logging.AddHook(hook)
}

if discordWebhookURL := discord.GetWebhookURLFromEnv(); discordWebhookURL != "" {
discordOpts := discord.GetDefaultOpts()
hook := discord.NewHook(tag, discordWebhookURL, discordOpts...)
logging.AddHook(hook)

// Workaround for Discord logger hook. Actually, it's Info.
log.Error(discord.StartLogMessage)
defer log.Error(discord.StopLogMessage)
} else {
log.Info(discord.StartLogMessage)
defer log.Info(discord.StopLogMessage)
}

var rdr io.Reader
var err error

Expand Down
16 changes: 0 additions & 16 deletions cmd/skywire-visor/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/pkg/profile"
"github.com/skycoin/dmsg/buildinfo"
"github.com/skycoin/dmsg/cmdutil"
"github.com/skycoin/dmsg/discord"
"github.com/skycoin/skycoin/src/util/logging"
"github.com/spf13/cobra"
"github.com/toqueteos/webbrowser"
Expand Down Expand Up @@ -63,15 +62,6 @@ var rootCmd = &cobra.Command{
Run: func(_ *cobra.Command, args []string) {
log := initLogger(tag, syslogAddr)

if discordWebhookURL := discord.GetWebhookURLFromEnv(); discordWebhookURL != "" {
// Workaround for Discord logger hook. Actually, it's Info.
log.Error(discord.StartLogMessage)
defer log.Error(discord.StopLogMessage)
} else {
log.Info(discord.StartLogMessage)
defer log.Info(discord.StopLogMessage)
}

delayDuration, err := time.ParseDuration(delay)
if err != nil {
log.WithError(err).Error("Failed to parse delay duration.")
Expand Down Expand Up @@ -173,12 +163,6 @@ func initLogger(tag string, syslogAddr string) *logging.MasterLogger {
}
}

if discordWebhookURL := discord.GetWebhookURLFromEnv(); discordWebhookURL != "" {
discordOpts := discord.GetDefaultOpts()
hook := discord.NewHook(tag, discordWebhookURL, discordOpts...)
log.AddHook(hook)
}

return log
}

Expand Down
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9 h1:sYNJzB4J8toYPQTM6pAkcm
golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
Expand Down

0 comments on commit bc08494

Please sign in to comment.