@@ -69,7 +69,7 @@ func (d *discardLogger) Level() Level {
69
69
70
70
func (d * discardLogger ) SetLevel (level Level ) {}
71
71
72
- type sampleLogger struct {
72
+ type SampleLogger struct {
73
73
DEBUG * log.Logger
74
74
ERROR * log.Logger
75
75
INFO * log.Logger
@@ -91,8 +91,8 @@ var DefaultLogger = NewDefaultLogger(defaultLogLevel)
91
91
// @param level Log level. See Level for details.
92
92
//
93
93
// @since v0.7.0
94
- func NewDefaultLogger (level Level ) * sampleLogger {
95
- return & sampleLogger {
94
+ func NewDefaultLogger (level Level ) * SampleLogger {
95
+ return & SampleLogger {
96
96
DEBUG : log .New (os .Stdout , fmt .Sprintf ("DEBUG %s " , defaultLogPrefix ), defaultLogFlag ),
97
97
ERROR : log .New (os .Stdout , fmt .Sprintf ("ERROR %s " , defaultLogPrefix ), defaultLogFlag ),
98
98
INFO : log .New (os .Stdout , fmt .Sprintf ("INFO %s " , defaultLogPrefix ), defaultLogFlag ),
@@ -101,58 +101,58 @@ func NewDefaultLogger(level Level) *sampleLogger {
101
101
}
102
102
}
103
103
104
- func (d * sampleLogger ) Debug (ctx context.Context , module string , v ... interface {}) {
104
+ func (d * SampleLogger ) Debug (ctx context.Context , module string , v ... interface {}) {
105
105
if d .level <= DebugLevel {
106
106
_ = d .DEBUG .Output (2 , fmt .Sprintln (v ... ))
107
107
}
108
108
}
109
109
110
- func (d * sampleLogger ) Debugf (ctx context.Context , module string , format string , v ... interface {}) {
110
+ func (d * SampleLogger ) Debugf (ctx context.Context , module string , format string , v ... interface {}) {
111
111
if d .level <= DebugLevel {
112
112
_ = d .DEBUG .Output (2 , fmt .Sprintf (format , v ... ))
113
113
}
114
114
}
115
115
116
- func (d * sampleLogger ) Error (ctx context.Context , module string , v ... interface {}) {
116
+ func (d * SampleLogger ) Error (ctx context.Context , module string , v ... interface {}) {
117
117
if d .level <= ErrLevel {
118
118
_ = d .ERROR .Output (2 , fmt .Sprintln (v ... ))
119
119
}
120
120
}
121
121
122
- func (d * sampleLogger ) Errorf (ctx context.Context , module string , format string , v ... interface {}) {
122
+ func (d * SampleLogger ) Errorf (ctx context.Context , module string , format string , v ... interface {}) {
123
123
if d .level <= ErrLevel {
124
124
_ = d .ERROR .Output (2 , fmt .Sprintf (format , v ... ))
125
125
}
126
126
}
127
127
128
- func (d * sampleLogger ) Info (ctx context.Context , module string , v ... interface {}) {
128
+ func (d * SampleLogger ) Info (ctx context.Context , module string , v ... interface {}) {
129
129
if d .level >= InfoLevel {
130
130
_ = d .INFO .Output (2 , fmt .Sprintln (v ... ))
131
131
}
132
132
}
133
133
134
- func (d * sampleLogger ) Infof (ctx context.Context , module string , format string , v ... interface {}) {
134
+ func (d * SampleLogger ) Infof (ctx context.Context , module string , format string , v ... interface {}) {
135
135
if d .level >= InfoLevel {
136
136
_ = d .WARN .Output (2 , fmt .Sprintln (v ... ))
137
137
}
138
138
}
139
139
140
- func (d * sampleLogger ) Warn (ctx context.Context , module string , v ... interface {}) {
140
+ func (d * SampleLogger ) Warn (ctx context.Context , module string , v ... interface {}) {
141
141
if d .level <= WarningLevel {
142
142
_ = d .WARN .Output (2 , fmt .Sprintln (v ... ))
143
143
}
144
144
}
145
145
146
- func (d * sampleLogger ) Warnf (ctx context.Context , module string , format string , v ... interface {}) {
146
+ func (d * SampleLogger ) Warnf (ctx context.Context , module string , format string , v ... interface {}) {
147
147
if d .level <= WarningLevel {
148
148
_ = d .WARN .Output (2 , fmt .Sprintf (format , v ... ))
149
149
}
150
150
}
151
151
152
- func (d * sampleLogger ) Level () Level {
152
+ func (d * SampleLogger ) Level () Level {
153
153
return d .level
154
154
}
155
155
156
- func (d * sampleLogger ) SetLevel (level Level ) {
156
+ func (d * SampleLogger ) SetLevel (level Level ) {
157
157
d .level = level
158
158
}
0 commit comments