Merge branch 'override-time' of git://github.com/sbrisson2/logrus into sbrisson2-override-time

This commit is contained in:
David Bariod
2018-07-12 22:16:18 +02:00
4 changed files with 94 additions and 2 deletions
+10
View File
@@ -2,6 +2,7 @@ package logrus
import (
"io"
"time"
)
var (
@@ -70,6 +71,15 @@ func WithFields(fields Fields) *Entry {
return std.WithFields(fields)
}
// WithTime creats an entry from the standard logger and overrides the time of
// logs generated with it.
//
// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal
// or Panic on the Entry it returns.
func WithTime(t time.Time) *Entry {
return std.WithTime(t)
}
// Debug logs a message at level Debug on the standard logger.
func Debug(args ...interface{}) {
std.Debug(args...)