From aa60a45eecb42ae6216e3eb53d0a876abb64b082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Tikvi=C4=87?= Date: Fri, 30 Mar 2018 10:46:47 +0200 Subject: [PATCH] changed log file signature --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 4472132..6318371 100644 --- a/main.go +++ b/main.go @@ -5,6 +5,7 @@ import ( "os" "path/filepath" "runtime" + "strings" "sync" "time" ) @@ -41,7 +42,8 @@ func New(name string, maxFileSize int64) (logger *Logger, err error) { } } - timestamp := "_" + time.Now().Format(time.RFC3339) + date := strings.Split(time.Now().Format(time.RFC3339), "T")[0] + timestamp := "_" + date path := filepath.Join(logDirName, logger.outputFileName+timestamp+".txt") logger.outputFile, err = os.Create(path) if err != nil { -- 1.8.1.2