Skip to content

Commit 787ca7d

Browse files
authored
Fix Sentry slog beforesendlog example
It wasn't copy pastable before. This code snippet fixes it.
1 parent de97c17 commit 787ca7d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/platforms/go/common/logs/index.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ To filter logs, or update them before they are sent to Sentry, you can use the `
134134
if err := sentry.Init(sentry.ClientOptions{
135135
Dsn: "___PUBLIC_DSN___",
136136
EnableLogs: true,
137-
BeforeSendLog: func(log *Log) *Log {
137+
BeforeSendLog: func(log *sentry.Log) *sentry.Log {
138138
// filter out all trace logs
139139
if log.Level == sentry.LogLevelTrace {
140140
return nil
@@ -144,6 +144,8 @@ if err := sentry.Init(sentry.ClientOptions{
144144
if log.Severity <= LogSeverityInfo {
145145
return nil
146146
}
147+
148+
return log
147149
},
148150
}); err != nil {
149151
fmt.Printf("Sentry initialization failed: %v\n", err)

0 commit comments

Comments
 (0)