fcbc25e789
We are replacing the very outdated redigo Go module with the official redis Go module, go-redis. Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
26 lines
522 B
Go
26 lines
522 B
Go
package internal
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"log"
|
|
"os"
|
|
)
|
|
|
|
type Logging interface {
|
|
Printf(ctx context.Context, format string, v ...interface{})
|
|
}
|
|
|
|
type logger struct {
|
|
log *log.Logger
|
|
}
|
|
|
|
func (l *logger) Printf(ctx context.Context, format string, v ...interface{}) {
|
|
_ = l.log.Output(2, fmt.Sprintf(format, v...))
|
|
}
|
|
|
|
// Logger calls Output to print to the stderr.
|
|
// Arguments are handled in the manner of fmt.Print.
|
|
var Logger Logging = &logger{
|
|
log: log.New(os.Stderr, "redis: ", log.LstdFlags|log.Lshortfile),
|
|
}
|