zapsentry

package
v2.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventIDKey     = "event_id"
	ProjectKey     = "project"
	TimestampKey   = "timestamp"
	LoggerKey      = "logger"
	PlatformKey    = "platform"
	CulpritKey     = "culprit"
	ServerNameKey  = "server_name"
	ErrorKey       = "error"
	HTTPRequestKey = "http_request"
	UserKey        = "user"
)
View Source
const (
	DefaultFlushTimeout = 5 * time.Second
)
View Source
const ErrorStackTraceKey = "error_stack_trace"
View Source
const SkipKey = "_zapsentry_skip"
View Source
const TagPrefix = "#"

Variables

This section is empty.

Functions

func Skip

func Skip() zapcore.Field

Skip returns a field that tells zapsentry to skip the log entry.

func UserField

func UserField(user User) zapcore.Field

UserField turns the given user object into a field.

Types

type Core

type Core struct {
	zapcore.LevelEnabler
	// contains filtered or unexported fields
}

func NewCore

func NewCore(enab zapcore.LevelEnabler, client *sentry.Client, options ...Option) *Core

func (*Core) Check

func (core *Core) Check(entry zapcore.Entry, checked *zapcore.CheckedEntry) *zapcore.CheckedEntry

func (*Core) Sync

func (core *Core) Sync() error

func (*Core) With

func (core *Core) With(fields []zapcore.Field) zapcore.Core

func (*Core) Write

func (core *Core) Write(entry zapcore.Entry, fields []zapcore.Field) error

type Option

type Option func(*Core)

func SetFlushTimeout

func SetFlushTimeout(timeout time.Duration) Option

func SetStackTraceSkip

func SetStackTraceSkip(skip int) Option

type StackTracer

type StackTracer interface {
	StackTrace() errors.StackTrace
}

type User

type User sentry.User

User extends sentry.User to be a zapcore.ObjectMarshaler.

This object can be passed to the logger as a field, causing the underlying core to set Event.User to the field value.

func (User) MarshalLogObject

func (user User) MarshalLogObject(enc zapcore.ObjectEncoder) error

MarshalLogObject implements zapcore.ObjectMarshaler interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL