2024-04-07 23:41:00 +07:00
|
|
|
package db
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"github.com/tigorlazuardi/redmage/pkg/caller"
|
|
|
|
"github.com/tigorlazuardi/redmage/pkg/log"
|
|
|
|
)
|
|
|
|
|
|
|
|
type gooseLogger struct{}
|
|
|
|
|
|
|
|
func (gl *gooseLogger) Fatalf(format string, v ...interface{}) {
|
|
|
|
format = strings.TrimSuffix(format, "\n")
|
2024-04-08 15:48:45 +07:00
|
|
|
log.New(context.Background()).Caller(caller.New(3)).Errorf(format, v...)
|
2024-04-07 23:41:00 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
func (gl *gooseLogger) Printf(format string, v ...interface{}) {
|
|
|
|
format = strings.TrimSuffix(format, "\n")
|
2024-04-08 15:48:45 +07:00
|
|
|
log.New(context.Background()).Caller(caller.New(3)).Infof(format, v...)
|
2024-04-07 23:41:00 +07:00
|
|
|
}
|