flog

package
v0.19.4 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DebugLevel = "debug"
	InfoLevel  = "info"
	WarnLevel  = "warn"
	ErrorLevel = "error"
	FatalLevel = "fatal"
	PanicLevel = "panic"
)

Variables

View Source
var AsynqLogger = &asynqLogger{}
View Source
var SlackLogger = &slackLogger{}
View Source
var WatermillLogger = &watermillLogger{}

Functions

func AsynqLogLevel

func AsynqLogLevel(level string) asynq.LogLevel

func Debug

func Debug(format string, a ...any)

func Error

func Error(err error)

func Fatal

func Fatal(format string, a ...any)

func GetLogger

func GetLogger() zerolog.Logger

func Info

func Info(format string, a ...any)

func Init

func Init(fileLogEnabled bool)

func Panic

func Panic(format string, a ...any)

func SetLevel

func SetLevel(level string)

SetLevel sets the global logging level based on the provided level.

level: The logging level to set. Valid values are "debug", "info", "warn",

"error", "fatal", "panic". If an invalid level is provided, the
default level is set to "info".

func Warn

func Warn(format string, a ...any)

Types

type GormLogger

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

func NewGormLogger

func NewGormLogger(level string) *GormLogger

func (*GormLogger) Error

func (g *GormLogger) Error(_ context.Context, s string, i ...interface{})

func (*GormLogger) Info

func (g *GormLogger) Info(_ context.Context, s string, i ...interface{})

func (*GormLogger) LogMode

func (g *GormLogger) LogMode(level logger.LogLevel) logger.Interface

func (*GormLogger) Trace

func (g *GormLogger) Trace(_ context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error)

func (*GormLogger) Warn

func (g *GormLogger) Warn(_ context.Context, s string, i ...interface{})

Jump to

Keyboard shortcuts

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