forked from docker/libcompose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
null.go
42 lines (33 loc) · 936 Bytes
/
null.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
package logger
import (
"io"
)
// NullLogger is a logger.Logger and logger.Factory implementation that does nothing.
type NullLogger struct {
}
// Out is a no-op function.
func (n *NullLogger) Out(_ []byte) {
}
// Err is a no-op function.
func (n *NullLogger) Err(_ []byte) {
}
// CreateContainerLogger allows NullLogger to implement logger.Factory.
func (n *NullLogger) CreateContainerLogger(_ string) Logger {
return &NullLogger{}
}
// CreateBuildLogger allows NullLogger to implement logger.Factory.
func (n *NullLogger) CreateBuildLogger(_ string) Logger {
return &NullLogger{}
}
// CreatePullLogger allows NullLogger to implement logger.Factory.
func (n *NullLogger) CreatePullLogger(_ string) Logger {
return &NullLogger{}
}
// OutWriter returns the base writer
func (n *NullLogger) OutWriter() io.Writer {
return nil
}
// ErrWriter returns the base writer
func (n *NullLogger) ErrWriter() io.Writer {
return nil
}