logger

package
v0.47.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const AuditEventField = "audit_event"

Variables

This section is empty.

Functions

func IsErrLog added in v0.31.2

func IsErrLog(p []byte) bool

func Log

func Log() *logrus.Logger

Types

type Entry added in v0.18.0

type Entry struct {
	*logrus.Entry
}

func WithContext

func WithContext(ctx context.Context) *Entry

func (*Entry) EWithFields added in v0.30.0

func (e *Entry) EWithFields(fields map[string]interface{}) *Entry

func (*Entry) PushWithAuditEvent added in v0.23.0

func (e *Entry) PushWithAuditEvent(event *audit.BasicEvent)

func (*Entry) WithAuditEvent added in v0.18.0

func (e *Entry) WithAuditEvent(event *audit.BasicEvent) *Entry

type GormLogger added in v0.16.0

type GormLogger struct {
	Logger                *logrus.Logger
	SlowThreshold         time.Duration
	SkipErrRecordNotFound bool
}

Inspired by: https://github.com/onrik/gorm-logrus/logger.go MIT License: https://github.com/onrik/gorm-logrus/LICENSE

func NewGormLogger added in v0.16.0

func NewGormLogger(logger *logrus.Logger, slowTreshold time.Duration, skipErrNotFound bool) *GormLogger

func (*GormLogger) Error added in v0.16.0

func (l *GormLogger) Error(ctx context.Context, s string, args ...interface{})

func (*GormLogger) Info added in v0.16.0

func (l *GormLogger) Info(ctx context.Context, s string, args ...interface{})

func (*GormLogger) LogMode added in v0.16.0

func (l *GormLogger) LogMode(glog.LogLevel) glog.Interface

func (*GormLogger) Trace added in v0.16.0

func (l *GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

func (*GormLogger) Warn added in v0.16.0

func (l *GormLogger) Warn(ctx context.Context, s string, args ...interface{})

type Writer added in v0.31.2

type Writer struct{}

Writer writes to stdout or stderr depending on severity level.

func (Writer) Write added in v0.31.2

func (Writer) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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