Skip to content

Commit 3c56dd3

Browse files
committed
docs(logsentry): fix stale golog API references after sweep
- WriterConfig godoc example used the nonexistent golog.ErrorLevel() package func -> golog.DefaultLevels.Error.FilterOutBelow(). - Prose references to the old golog.ErrorHandler var now use the function form golog.ErrorHandler() after the thread-safe accessor refactor. Swept all .md and non-test .go: no other occurrences of the broken golog.XxxLevel() calls or old golog.ErrorHandler var usage remain.
1 parent 496db26 commit 3c56dd3

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

logsentry/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ func NewWriterConfig(
244244
- **`filter`**: Level filter to control which log levels are sent to Sentry. Use `golog.AllLevelsActive` to send all levels.
245245
- **`valsAsMsg`**: If `true`, includes key-value pairs in the message text. If `false`, only sends them in the `log` context.
246246
- **`extra`**: Additional data to include in the `log` context of every Sentry event (e.g., service name, version).
247-
- **`opts`**: Optional settings. Use `WithErrorHandler(func(error))` to route errors that occur while logging to Sentry into your normal logs (defaults to `golog.ErrorHandler`).
247+
- **`opts`**: Optional settings. Use `WithErrorHandler(func(error))` to route errors that occur while logging to Sentry into your normal logs (defaults to `golog.ErrorHandler()`).
248248

249249
### Global Configuration
250250

@@ -259,7 +259,7 @@ logsentry.FlushTimeout = 5 * time.Second
259259
## How to route Sentry logging errors into your normal logs
260260

261261
By default, problems that happen while logging to Sentry are easy to miss: writer-side
262-
failures go to `golog.ErrorHandler` (stderr), and Sentry's own transport failures (HTTP 413
262+
failures go to `golog.ErrorHandler()` (stderr), and Sentry's own transport failures (HTTP 413
263263
"payload too large", network errors) happen asynchronously inside the Sentry SDK and never
264264
reach golog at all. This how-to routes both into a handler of your choice so they show up in
265265
your normal, non-Sentry logs.
@@ -370,7 +370,7 @@ func main() {
370370

371371
### Setting a default handler instead
372372

373-
If you do not pass `WithErrorHandler`, writer-side errors go to `golog.ErrorHandler`, which
373+
If you do not pass `WithErrorHandler`, writer-side errors go to `golog.ErrorHandler()`, which
374374
prints to stderr by default. Set a process-wide handler once at startup with
375375
`golog.SetErrorHandler`:
376376

@@ -426,7 +426,7 @@ sentry logging error: sentry: error sending envelope: ...
426426

427427
- **Graceful Degradation**: Application continues running even if Sentry integration fails
428428
- **No Panics**: The package is designed to never panic during normal operation
429-
- **Surfaceable Errors**: By default errors are sent to `golog.ErrorHandler` (stderr). Pass
429+
- **Surfaceable Errors**: By default errors are sent to `golog.ErrorHandler()` (stderr). Pass
430430
`WithErrorHandler` to `NewWriterConfig` to route writer errors into your normal logs, and
431431
assign `NewSentryDebugWriter(handler)` to `sentry.ClientOptions.DebugWriter` (with
432432
`Debug: true`) to capture Sentry's asynchronous transport failures (HTTP 413, network errors)

logsentry/writer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var (
4141
// config := logsentry.NewWriterConfig(
4242
// sentry.CurrentHub(),
4343
// golog.NewDefaultFormat(),
44-
// golog.ErrorLevel().FilterOutBelow(),
44+
// golog.DefaultLevels.Error.FilterOutBelow(),
4545
// false,
4646
// map[string]any{"service": "my-app"},
4747
// )

0 commit comments

Comments
 (0)