logging

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogSentry

func LogSentry(err error)

LogSentry writes errors to Sentry. Ensure NewSentryLogger() is called first to initialize the Sentry SDK with options.

func NewSentryLogger

func NewSentryLogger(sentryDSN string) error

NewSentryLogger initializes Sentry SDK with options.

Types

type LocalLogger

type LocalLogger struct {
}

func NewLocalLogger

func NewLocalLogger() *LocalLogger

NewLocalLogger creates a new LocalLogger.

func (*LocalLogger) Close

func (l *LocalLogger) Close()

Close is a no-op.

func (*LocalLogger) Criticalf

func (l *LocalLogger) Criticalf(format string, a ...any)

Criticalf writes CRITICAL severity logs to STDERR.

func (*LocalLogger) Debugf

func (l *LocalLogger) Debugf(format string, a ...any)

Debugf writes DEBUG severity logs to STDERR.

func (*LocalLogger) Errorf

func (l *LocalLogger) Errorf(format string, a ...any)

Errorf writes ERROR severity logs to STDERR.

func (*LocalLogger) Fatalf

func (l *LocalLogger) Fatalf(format string, a ...any)

Fatalf writes CRITICAL severity log to STDERR, and aborts the caller process by exiting 1.

func (*LocalLogger) Infof

func (l *LocalLogger) Infof(format string, a ...any)

Infof writes INFO severity logs to STDERR.

func (*LocalLogger) Warningf

func (l *LocalLogger) Warningf(format string, a ...any)

Warningf writes WARNING severity logs to STDERR.

type Severity

type Severity string
const (
	DEBUG    Severity = "DEBUG"
	INFO     Severity = "INFO"
	WARNING  Severity = "WARNING"
	ERROR    Severity = "ERROR"
	CRITICAL Severity = "CRITICAL"
)

Jump to

Keyboard shortcuts

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