Skip to content

Commit

Permalink
Merge pull request #21 from x-cray/feature/fix-default-timestamp
Browse files Browse the repository at this point in the history
Use private constant for default timestamp format
  • Loading branch information
x-cray authored Jul 27, 2017
2 parents 0b2c791 + 5f3f200 commit 3abfd71
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
"github.com/mgutz/ansi"
)

const defaultTimestampFormat = time.RFC3339

var (
baseTimestamp time.Time = time.Now()
defaultColorScheme *ColorScheme = &ColorScheme{
Expand Down Expand Up @@ -175,7 +177,7 @@ func (f *TextFormatter) Format(entry *logrus.Entry) ([]byte, error) {

timestampFormat := f.TimestampFormat
if timestampFormat == "" {
timestampFormat = logrus.DefaultTimestampFormat
timestampFormat = defaultTimestampFormat
}
if isFormatted {
isColored := (f.ForceColors || f.isTerminal) && !f.DisableColors
Expand Down

0 comments on commit 3abfd71

Please sign in to comment.