log

package
v0.0.0-...-11559a6 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

func Error

func Error(args ...interface{})

func Fatal

func Fatal(args ...interface{})

func Info

func Info(args ...interface{})

func NewDefaultGormLogger

func NewDefaultGormLogger() logger.Interface

func NewGormLogger

func NewGormLogger(config Config) logger.Interface

func Trace

func Trace(args ...interface{})

func Warn

func Warn(args ...interface{})

func WithSkipGorm

func WithSkipGorm(flag bool) func(*FileWithLineNumOptions)

func WithSkipHelper

func WithSkipHelper(flag bool) func(*FileWithLineNumOptions)

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

type FileWithLineNumOptions

type FileWithLineNumOptions struct {
	// contains filtered or unexported fields
}

type Interface

type Interface interface {
	Options() Options
	WithFields(fields map[string]interface{}) Interface
	Log(level Level, v ...interface{})
	Logf(level Level, format string, v ...interface{})
}

Interface logger interface

func New

func New(options ...func(*Options)) (l Interface)

type Level

type Level uint32
const (
	PanicLevel Level = iota
	FatalLevel
	ErrorLevel
	WarnLevel
	InfoLevel
	DebugLevel
	TraceLevel
)

func (Level) Enabled

func (l Level) Enabled(lv Level) bool

func (Level) LevelToGorm

func (l Level) LevelToGorm() logger.LogLevel

type Options

type Options struct {
	// contains filtered or unexported fields
}

type Wrapper

type Wrapper struct {
	// contains filtered or unexported fields
}
var DefaultWrapper *Wrapper

func NewWrapper

func NewWrapper(l Interface) *Wrapper

func WithContext

func WithContext(ctx context.Context) *Wrapper

func WithError

func WithError(err error) *Wrapper

func WithField

func WithField(k string, v interface{}) *Wrapper

func WithFields

func WithFields(fields map[string]interface{}) *Wrapper

func (*Wrapper) Debug

func (w *Wrapper) Debug(args ...interface{})

func (*Wrapper) Error

func (w *Wrapper) Error(args ...interface{})

func (*Wrapper) Fatal

func (w *Wrapper) Fatal(args ...interface{})

func (*Wrapper) Info

func (w *Wrapper) Info(args ...interface{})

func (*Wrapper) Trace

func (w *Wrapper) Trace(args ...interface{})

func (*Wrapper) Warn

func (w *Wrapper) Warn(args ...interface{})

func (*Wrapper) WithContext

func (w *Wrapper) WithContext(ctx context.Context) *Wrapper

func (*Wrapper) WithError

func (w *Wrapper) WithError(err error) *Wrapper

func (*Wrapper) WithFields

func (w *Wrapper) WithFields(fields map[string]interface{}) *Wrapper

Jump to

Keyboard shortcuts

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