logger

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

pkg/logger/logger.go

Index

Constants

This section is empty.

Variables

Functions

func InitLogger

func InitLogger(logLevel string)

Types

type AsynqLoggerAdapter

type AsynqLoggerAdapter struct{}

AsynqLoggerAdapter implements the asynq.Logger interface and routes logs to our application's standard logger (Logrus) with a structured "source" field.

func (*AsynqLoggerAdapter) Debug

func (l *AsynqLoggerAdapter) Debug(args ...any)

Debug logs debug-level messages from asynq.

func (*AsynqLoggerAdapter) Error

func (l *AsynqLoggerAdapter) Error(args ...any)

Error logs error messages from asynq.

func (*AsynqLoggerAdapter) Fatal

func (l *AsynqLoggerAdapter) Fatal(args ...any)

Fatal logs fatal error messages from asynq and exits.

func (*AsynqLoggerAdapter) Info

func (l *AsynqLoggerAdapter) Info(args ...any)

Info logs informational messages from asynq.

func (*AsynqLoggerAdapter) Warn

func (l *AsynqLoggerAdapter) Warn(args ...any)

Warn logs warning messages from asynq.

type GormLogger

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

GormLogger wraps logrus for GORM

func NewGormLogger

func NewGormLogger(logLevel logger.LogLevel) *GormLogger

NewGormLogger initializes a GORM logger using logrus

func (*GormLogger) Error

func (l *GormLogger) Error(ctx context.Context, msg string, data ...any)

Error logs error messages

func (*GormLogger) Info

func (l *GormLogger) Info(ctx context.Context, msg string, data ...any)

Info logs informational messages

func (*GormLogger) LogMode

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

LogMode sets the log level for GORM

func (*GormLogger) Trace

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

Trace logs SQL queries with execution time

func (*GormLogger) Warn

func (l *GormLogger) Warn(ctx context.Context, msg string, data ...any)

Warn logs warning messages

Jump to

Keyboard shortcuts

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