blob: 3810f9e4e7ac9948ca9deebc6839f4934acc6373 [file] [log] [blame]
serkant.uluderyae5afeff2021-02-23 18:00:23 +03001package internal
2
3import (
4 "context"
5 "fmt"
6 "log"
7 "os"
8)
9
10type Logging interface {
11 Printf(ctx context.Context, format string, v ...interface{})
12}
13
14type logger struct {
15 log *log.Logger
16}
17
18func (l *logger) Printf(ctx context.Context, format string, v ...interface{}) {
19 _ = l.log.Output(2, fmt.Sprintf(format, v...))
20}
21
22var Logger Logging = &logger{
23 log: log.New(os.Stderr, "redis: ", log.LstdFlags|log.Lshortfile),
24}