Skip to content

Commit

Permalink
improved worker logger;
Browse files Browse the repository at this point in the history
  • Loading branch information
jacekk committed Aug 18, 2019
1 parent 64d54f5 commit 29857e4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/worker/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package worker
import (
"fmt"
"os"
"time"
)

type logger interface {
Expand All @@ -12,6 +13,7 @@ type logger interface {
type loggerImpl struct{}

func (l *loggerImpl) Info(baseFormat string, args ...interface{}) {
format := fmt.Sprintf("%s %s \n", loggerPrefix, baseFormat)
now := time.Now().Format("2006/01/02 - 15:04:05")
format := fmt.Sprintf("%s %s | %s \n", loggerPrefix, now, baseFormat)
fmt.Fprintf(os.Stdout, format, args...)
}

0 comments on commit 29857e4

Please sign in to comment.