Skip to content

Commit

Permalink
✨ Add new methods to logger: Debugd, Infod, etc...
Browse files Browse the repository at this point in the history
Signed-off-by: Rintaro Okamura <[email protected]>

:sparkles: Add Close method to logger implementations

Signed-off-by: Rintaro Okamura <[email protected]>
  • Loading branch information
rinx committed Jan 21, 2021
1 parent 15c752e commit 5dbfd2e
Show file tree
Hide file tree
Showing 10 changed files with 1,938 additions and 0 deletions.
24 changes: 24 additions & 0 deletions internal/log/glg/glg.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ func (l *logger) setLogFormat(fmt format.Format) *logger {
return l
}

func (l *logger) Close() error {
return nil
}

func (l *logger) Info(vals ...interface{}) {
l.retry.Out(l.glg.Info, vals...)
}
Expand All @@ -81,6 +85,10 @@ func (l *logger) Infof(format string, vals ...interface{}) {
l.retry.Outf(l.glg.Infof, format, vals...)
}

func (l *logger) Infod(msg string, details ...interface{}) {
l.Infof(msg+"\tdetails: %#v", details)
}

func (l *logger) Debug(vals ...interface{}) {
l.retry.Out(l.glg.Debug, vals...)
}
Expand All @@ -89,6 +97,10 @@ func (l *logger) Debugf(format string, vals ...interface{}) {
l.retry.Outf(l.glg.Debugf, format, vals...)
}

func (l *logger) Debugd(msg string, details ...interface{}) {
l.Debugf(msg+"\tdetails: %#v", details)
}

func (l *logger) Warn(vals ...interface{}) {
l.retry.Out(l.glg.Warn, vals...)
}
Expand All @@ -97,6 +109,10 @@ func (l *logger) Warnf(format string, vals ...interface{}) {
l.retry.Outf(l.glg.Warnf, format, vals...)
}

func (l *logger) Warnd(msg string, details ...interface{}) {
l.Warnf(msg+"\tdetails: %#v", details)
}

func (l *logger) Error(vals ...interface{}) {
l.retry.Out(l.glg.Error, vals...)
}
Expand All @@ -105,10 +121,18 @@ func (l *logger) Errorf(format string, vals ...interface{}) {
l.retry.Outf(l.glg.Errorf, format, vals...)
}

func (l *logger) Errord(msg string, details ...interface{}) {
l.Errorf(msg+"\tdetails: %#v", details)
}

func (l *logger) Fatal(vals ...interface{}) {
l.glg.Fatal(vals...)
}

func (l *logger) Fatalf(format string, vals ...interface{}) {
l.glg.Fatalf(format, vals...)
}

func (l *logger) Fatald(msg string, details ...interface{}) {
l.Fatalf(msg+"\tdetails: %#v", details)
}
Loading

0 comments on commit 5dbfd2e

Please sign in to comment.