OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / tendermint / tmlibs / log / logger.go
1 package log
2
3 import (
4         "io"
5
6         kitlog "github.com/go-kit/kit/log"
7 )
8
9 // Logger is what any Tendermint library should take.
10 type Logger interface {
11         Debug(msg string, keyvals ...interface{})
12         Info(msg string, keyvals ...interface{})
13         Error(msg string, keyvals ...interface{})
14
15         With(keyvals ...interface{}) Logger
16 }
17
18 // NewSyncWriter returns a new writer that is safe for concurrent use by
19 // multiple goroutines. Writes to the returned writer are passed on to w. If
20 // another write is already in progress, the calling goroutine blocks until
21 // the writer is available.
22 //
23 // If w implements the following interface, so does the returned writer.
24 //
25 //    interface {
26 //        Fd() uintptr
27 //    }
28 func NewSyncWriter(w io.Writer) io.Writer {
29         return kitlog.NewSyncWriter(w)
30 }