diff --git a/entry.go b/entry.go index c38898c..8cd312e 100644 --- a/entry.go +++ b/entry.go @@ -15,14 +15,6 @@ type Entry struct { var baseTimestamp time.Time -func init() { - baseTimestamp = time.Now() -} - -func miniTS() int { - return int(time.Since(baseTimestamp) / time.Second) -} - func NewEntry(logger *Logger) *Entry { return &Entry{ Logger: logger, diff --git a/text_formatter.go b/text_formatter.go index b787c66..28a239d 100644 --- a/text_formatter.go +++ b/text_formatter.go @@ -4,6 +4,7 @@ import ( "fmt" "sort" "strings" + "time" ) const ( @@ -14,6 +15,14 @@ const ( blue = 34 ) +func init() { + baseTimestamp = time.Now() +} + +func miniTS() int { + return int(time.Since(baseTimestamp) / time.Second) +} + type TextFormatter struct { // Set to true to bypass checking for a TTY before outputting colors. ForceColors bool