logger

package
v2.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

func NewLogger

func NewLogger(opts ...Option) *Logger

func (*Logger) ErrorLog

func (l *Logger) ErrorLog(ctx context.Context, err error, format string, v ...any)

func (*Logger) ReadLog

func (l *Logger) ReadLog(ctx context.Context, format string, v ...any)

func (*Logger) WriteLog

func (l *Logger) WriteLog(ctx context.Context, format string, v ...any)

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithLogFields

func WithLogFields(fields map[string]any) Option

func WithOutputQueryLogType

func WithOutputQueryLogType(t OutputQueryLogType) Option

type OutputQueryLogType

type OutputQueryLogType string
const (
	// output log nothing
	OutputQueryLogTypeNone OutputQueryLogType = "none"

	// output log all query
	OutputQueryLogTypeAll OutputQueryLogType = "all"

	// output log only for select query
	OutputQueryLogTypeReadOnly OutputQueryLogType = "read"

	// output log only for insert/update/delete query
	OutputQueryLogTypeWriteOnly OutputQueryLogType = "write"
)

func (OutputQueryLogType) AllowReadLog

func (t OutputQueryLogType) AllowReadLog() bool

func (OutputQueryLogType) AllowWriteLog

func (t OutputQueryLogType) AllowWriteLog() bool

Jump to

Keyboard shortcuts

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