remove dsn and add logging to all

This commit is contained in:
Seraphim Strub 2023-04-23 01:23:52 +02:00
parent ec1462cfef
commit fed288f501
6 changed files with 135 additions and 6 deletions

View file

@ -10,6 +10,7 @@ import (
"github.com/disgoorg/disgo/rest"
"github.com/disgoorg/disgo/webhook"
"github.com/disgoorg/snowflake/v2"
"github.com/getsentry/sentry-go"
"grow.rievo.dev/discordBots/cmd/domaincheckbot/config"
"grow.rievo.dev/discordBots/cmd/domaincheckbot/dns"
"grow.rievo.dev/discordBots/cmd/domaincheckbot/repository"
@ -28,7 +29,26 @@ var (
// TODO: clear db from domains removed from json
// sentry
var release string
func main() {
err := sentry.Init(sentry.ClientOptions{
// Either set your DSN here or set the SENTRY_DSN environment variable.
//Dsn: "",
// Set TracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production,
TracesSampleRate: 1.0,
Release: release,
})
if err != nil {
log.Fatalf("sentry.Init: %s", err)
}
// Flush buffered events before the program terminates.
defer sentry.Flush(2 * time.Second)
log.Printf("INFO: starting domainCheck...")
log.Printf("INFO: disgo version: %v", disgo.Version)
@ -66,7 +86,9 @@ func main() {
}
}()
log.Printf("INFO: domainCheck is now running. Press CTRL-C to exit.")
log.Printf("INFO: domaincheckbot (%v) is now running. Press CTRL-C to exit.", release)
sentry.CaptureMessage("DEBUG: domaincheckbot started")
s := make(chan os.Signal, 1)
signal.Notify(s, syscall.SIGINT, syscall.SIGTERM, os.Interrupt)
<-s