slog

package
v0.0.0-...-c802062 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HookStandardLog

func HookStandardLog(w io.Writer)

func MustSetDSNAndHandler

func MustSetDSNAndHandler(dsn string)

func NewSB

func NewSB() logging.LeveledBackend

func Record2Level

func Record2Level(rec *logging.Record) raven.Severity

func RedirectStandardLog

func RedirectStandardLog(logWriter io.Writer, withSentry bool)

func SetupGoLogging

func SetupGoLogging(logPath string, dsn string, andStandardLog bool)

andStandardLog - hook https://golang.org/pkg/log calls also

func SetupSentryLogger

func SetupSentryLogger()

func SkipSpace

func SkipSpace(s string) string

Types

type LoggingRecord

type LoggingRecord struct {
	ID     uint64
	Time   time.Time
	Module string
	Level  logging.Level
	Args   []interface{}
	// contains filtered or unexported fields
}

type SentryBackend

type SentryBackend struct {
}

func (*SentryBackend) GetLevel

func (l *SentryBackend) GetLevel(module string) logging.Level

func (*SentryBackend) IsEnabledFor

func (l *SentryBackend) IsEnabledFor(level logging.Level, module string) bool

func (*SentryBackend) Log

func (l *SentryBackend) Log(level logging.Level, calldepth int, rec *logging.Record) error

func (*SentryBackend) SetLevel

func (l *SentryBackend) SetLevel(level logging.Level, module string)

type SentryLog

type SentryLog struct {
	Writer io.Writer
}

func (*SentryLog) Write

func (w *SentryLog) Write(p []byte) (n int, err error)

io.Writer interface for log

Jump to

Keyboard shortcuts

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