gormlogger

package module
v0.0.0-...-b94210c Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: MIT Imports: 4 Imported by: 0

README

Gormlogger

Logger designed to fit the needs of the gorm orm. Under the hood zap is used for structured logging.

Install

go get github.com/CubicrootXYZ/gormlogger

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
}

Logger gormlogger

func NewLogger

func NewLogger() *Logger

NewLogger makes a new logger instance

func (*Logger) Error

func (logger *Logger) Error(ctx context.Context, msg string, args ...interface{})

Error log

func (*Logger) Info

func (logger *Logger) Info(ctx context.Context, msg string, args ...interface{})

Info log

func (*Logger) LogMode

func (logger *Logger) LogMode(level gormlog.LogLevel) gormlog.Interface

LogMode sets the log level

func (*Logger) Sync

func (logger *Logger) Sync()

Sync call defer logger.Sync() to empty the buffer

func (*Logger) Trace

func (logger *Logger) Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error)

Trace log

func (*Logger) Warn

func (logger *Logger) Warn(ctx context.Context, msg string, args ...interface{})

Warn log

Jump to

Keyboard shortcuts

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