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 {