Skip to content

Commit

Permalink
update options comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ribice committed Aug 4, 2024
1 parent 1c45a32 commit 4762153
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions zerolog/sentryzerolog.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ const (
// These fields are simply omitted, as they are duplicated by the Sentry SDK.
FieldGoVersion = "go_version"
FieldMaxProcs = "go_maxprocs"
logger = "zerolog"

// Name of the logger used by the Sentry SDK.
logger = "zerolog"
)

// A good portion of this implementation has been taken from https://github.com/archdx/zerolog-sentry/blob/master/writer.go
Expand All @@ -64,11 +66,20 @@ type Config struct {
}

type Options struct {
// The log levels to send to Sentry. Default levels are Error, Fatal, and Panic.
// Levels specifies the log levels that will trigger event sending to Sentry.
// Only log messages at these levels will be sent. By default, the levels are
// Error, Fatal, and Panic, which capture critical issues.
Levels []zerolog.Level
// Enable to add log entries as breadcrumbs in Sentry.

// WithBreadcrumbs, when enabled, adds log entries as breadcrumbs in Sentry.
// Breadcrumbs provide a trail of events leading up to an error, which can
// be invaluable for understanding the context of issues.
WithBreadcrumbs bool
// The timeout duration for flushing events to Sentry.

// FlushTimeout sets the maximum duration allowed for flushing events to Sentry.
// This is the time limit within which all pending events must be sent to Sentry
// before the application exits. A typical use is ensuring all logs are sent before
// application shutdown. The default timeout is usually 3 seconds.
FlushTimeout time.Duration
}

Expand Down

0 comments on commit 4762153

Please sign in to comment.