forked from docker/libcompose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
raw_logger.go
48 lines (37 loc) · 1.03 KB
/
raw_logger.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
48
package logger
import (
"fmt"
"io"
"os"
)
// RawLogger is a logger.Logger and logger.Factory implementation that prints raw data with no formatting.
type RawLogger struct {
}
// Out is a no-op function.
func (r *RawLogger) Out(message []byte) {
fmt.Print(string(message))
}
// Err is a no-op function.
func (r *RawLogger) Err(message []byte) {
fmt.Fprint(os.Stderr, string(message))
}
// CreateContainerLogger allows RawLogger to implement logger.Factory.
func (r *RawLogger) CreateContainerLogger(_ string) Logger {
return &RawLogger{}
}
// CreateBuildLogger allows RawLogger to implement logger.Factory.
func (r *RawLogger) CreateBuildLogger(_ string) Logger {
return &RawLogger{}
}
// CreatePullLogger allows RawLogger to implement logger.Factory.
func (r *RawLogger) CreatePullLogger(_ string) Logger {
return &RawLogger{}
}
// OutWriter returns the base writer
func (r *RawLogger) OutWriter() io.Writer {
return os.Stdout
}
// ErrWriter returns the base writer
func (r *RawLogger) ErrWriter() io.Writer {
return os.Stderr
}