Skip to content

Commit 228a2d7

Browse files
committed
fix: Rename sampleLogger to SampleLogger for consistency
1 parent f003e36 commit 228a2d7

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

agora/log/log.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func (d *discardLogger) Level() Level {
6969

7070
func (d *discardLogger) SetLevel(level Level) {}
7171

72-
type sampleLogger struct {
72+
type SampleLogger struct {
7373
DEBUG *log.Logger
7474
ERROR *log.Logger
7575
INFO *log.Logger
@@ -91,8 +91,8 @@ var DefaultLogger = NewDefaultLogger(defaultLogLevel)
9191
// @param level Log level. See Level for details.
9292
//
9393
// @since v0.7.0
94-
func NewDefaultLogger(level Level) *sampleLogger {
95-
return &sampleLogger{
94+
func NewDefaultLogger(level Level) *SampleLogger {
95+
return &SampleLogger{
9696
DEBUG: log.New(os.Stdout, fmt.Sprintf("DEBUG %s ", defaultLogPrefix), defaultLogFlag),
9797
ERROR: log.New(os.Stdout, fmt.Sprintf("ERROR %s ", defaultLogPrefix), defaultLogFlag),
9898
INFO: log.New(os.Stdout, fmt.Sprintf("INFO %s ", defaultLogPrefix), defaultLogFlag),
@@ -101,58 +101,58 @@ func NewDefaultLogger(level Level) *sampleLogger {
101101
}
102102
}
103103

104-
func (d *sampleLogger) Debug(ctx context.Context, module string, v ...interface{}) {
104+
func (d *SampleLogger) Debug(ctx context.Context, module string, v ...interface{}) {
105105
if d.level <= DebugLevel {
106106
_ = d.DEBUG.Output(2, fmt.Sprintln(v...))
107107
}
108108
}
109109

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{}) {
111111
if d.level <= DebugLevel {
112112
_ = d.DEBUG.Output(2, fmt.Sprintf(format, v...))
113113
}
114114
}
115115

116-
func (d *sampleLogger) Error(ctx context.Context, module string, v ...interface{}) {
116+
func (d *SampleLogger) Error(ctx context.Context, module string, v ...interface{}) {
117117
if d.level <= ErrLevel {
118118
_ = d.ERROR.Output(2, fmt.Sprintln(v...))
119119
}
120120
}
121121

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{}) {
123123
if d.level <= ErrLevel {
124124
_ = d.ERROR.Output(2, fmt.Sprintf(format, v...))
125125
}
126126
}
127127

128-
func (d *sampleLogger) Info(ctx context.Context, module string, v ...interface{}) {
128+
func (d *SampleLogger) Info(ctx context.Context, module string, v ...interface{}) {
129129
if d.level >= InfoLevel {
130130
_ = d.INFO.Output(2, fmt.Sprintln(v...))
131131
}
132132
}
133133

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{}) {
135135
if d.level >= InfoLevel {
136136
_ = d.WARN.Output(2, fmt.Sprintln(v...))
137137
}
138138
}
139139

140-
func (d *sampleLogger) Warn(ctx context.Context, module string, v ...interface{}) {
140+
func (d *SampleLogger) Warn(ctx context.Context, module string, v ...interface{}) {
141141
if d.level <= WarningLevel {
142142
_ = d.WARN.Output(2, fmt.Sprintln(v...))
143143
}
144144
}
145145

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{}) {
147147
if d.level <= WarningLevel {
148148
_ = d.WARN.Output(2, fmt.Sprintf(format, v...))
149149
}
150150
}
151151

152-
func (d *sampleLogger) Level() Level {
152+
func (d *SampleLogger) Level() Level {
153153
return d.level
154154
}
155155

156-
func (d *sampleLogger) SetLevel(level Level) {
156+
func (d *SampleLogger) SetLevel(level Level) {
157157
d.level = level
158158
}

0 commit comments

Comments
 (0)