Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add log/mock/logger test #538

Merged
merged 1 commit into from
Jul 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions internal/log/mock/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
//
package mock

// Logger represents struct of each log level function
type Logger struct {
DebugFunc func(vals ...interface{})
DebugfFunc func(format string, vals ...interface{})
Expand All @@ -28,42 +29,52 @@ type Logger struct {
FatalfFunc func(format string, vals ...interface{})
}

// Debug calls DebugFunc of Logger
func (l *Logger) Debug(vals ...interface{}) {
l.DebugFunc(vals...)
}

// Debugf calls DebugfFunc of Logger
func (l *Logger) Debugf(format string, vals ...interface{}) {
l.DebugfFunc(format, vals...)
}

// Info calls InfoFunc of Logger
func (l *Logger) Info(vals ...interface{}) {
l.InfoFunc(vals...)
}

// Infof calls InfofFunc of Logger
func (l *Logger) Infof(format string, vals ...interface{}) {
l.InfofFunc(format, vals...)
}

// Warn calls WarnFunc of Logger
func (l *Logger) Warn(vals ...interface{}) {
l.WarnFunc(vals...)
}

// Warnf calls WarnfFunc of Logger
func (l *Logger) Warnf(format string, vals ...interface{}) {
l.WarnfFunc(format, vals...)
}

// Error calls ErrorFunc of Logger
func (l *Logger) Error(vals ...interface{}) {
l.ErrorFunc(vals...)
}

// Errorf calls ErrorfFunc of Logger
func (l *Logger) Errorf(format string, vals ...interface{}) {
l.ErrorfFunc(format, vals...)
}

// Fatal calls FatalFunc of Logger
func (l *Logger) Fatal(vals ...interface{}) {
l.FatalFunc(vals...)
}

// Fatalf calls FatalfFunc of Logger
func (l *Logger) Fatalf(format string, vals ...interface{}) {
l.FatalfFunc(format, vals...)
}
Loading