Skip to content

Commit

Permalink
change logging to always output the same date format
Browse files Browse the repository at this point in the history
longer but looks nicer when you query the past few days
  • Loading branch information
tj committed Mar 15, 2018
1 parent 6d27f34 commit 73cd81b
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions internal/logs/text/text.go
Expand Up @@ -177,14 +177,7 @@ var day = time.Hour * 24

// formatDate formats t relative to now.
func formatDate(t time.Time) string {
switch d := time.Since(t); {
case d >= day*7:
return t.Format(`Jan 2` + util.DateSuffix(t) + ` 03:04:05pm`)
case d >= day:
return t.Format(`2` + util.DateSuffix(t) + ` 03:04:05pm`)
default:
return t.Format(`03:04:05pm`)
}
return t.Format(`Jan 2` + util.DateSuffix(t) + ` 03:04:05pm`)
}

// version returns the entry version via GIT commit or lambda version.
Expand Down

0 comments on commit 73cd81b

Please sign in to comment.