-
Notifications
You must be signed in to change notification settings - Fork 0
/
nopwriter.go
47 lines (28 loc) · 920 Bytes
/
nopwriter.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package golog
import (
"context"
"time"
)
// NopWriter is a Writer that does nothing (no operation)
const NopWriter nopWriter = 0
type nopWriter int
func (w nopWriter) BeginMessage(_ context.Context, logger *Logger, t time.Time, level Level, text string) Writer {
return w
}
func (nopWriter) CommitMessage() {}
func (nopWriter) FlushUnderlying() {}
func (nopWriter) String() string {
return "NopWriter"
}
func (nopWriter) WriteKey(key string) {}
func (nopWriter) WriteSliceKey(key string) {}
func (nopWriter) WriteSliceEnd() {}
func (nopWriter) WriteNil() {}
func (nopWriter) WriteBool(val bool) {}
func (nopWriter) WriteInt(val int64) {}
func (nopWriter) WriteUint(val uint64) {}
func (nopWriter) WriteFloat(val float64) {}
func (nopWriter) WriteString(val string) {}
func (nopWriter) WriteError(val error) {}
func (nopWriter) WriteUUID(val [16]byte) {}
func (nopWriter) WriteJSON(val []byte) {}