bunker/commons/goose_logger.go
Stanislav N. aka pztrn 71c80799d2
Some checks failed
Linting and tests / Tests (push) Failing after 1m22s
Linting and tests / Linting (push) Failing after 1m32s
Linter configuration and linting.
2025-09-11 02:30:15 +05:00

29 lines
693 B
Go

package commons
import (
"fmt"
"log/slog"
)
// GooseLogger is a proxy struct that wraps Bunker logging for goose database migrator.
type GooseLogger struct {
logger *slog.Logger
}
// NewGooseLogger creates proxy structure for goose database migrator logging.
func NewGooseLogger(logger *slog.Logger) *GooseLogger {
return &GooseLogger{
logger: logger.With("module", "goose"),
}
}
// Fatalf is a proxy for goose logging.
func (gl *GooseLogger) Fatalf(format string, v ...interface{}) {
gl.logger.Error(fmt.Sprintf(format, v...))
}
// Printf is a proxy for goose logging.
func (gl *GooseLogger) Printf(format string, v ...interface{}) {
gl.logger.Info(fmt.Sprintf(format, v...))
}