Improve client logging.
Some checks failed
Linting and tests / Linting (push) Failing after 4s
Linting and tests / Tests (push) Failing after 3s

This commit is contained in:
2025-09-10 20:04:19 +05:00
parent e3b9c9ae40
commit c2142cc1a6
15 changed files with 118 additions and 44 deletions

26
commons/goose_logger.go Normal file
View File

@@ -0,0 +1,26 @@
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"),
}
}
func (gl *GooseLogger) Fatalf(format string, v ...interface{}) {
gl.logger.Error(fmt.Sprintf(format, v...))
}
func (gl *GooseLogger) Printf(format string, v ...interface{}) {
gl.logger.Info(fmt.Sprintf(format, v...))
}