Skip to content

Commit a6923c9

Browse files
authored
Update file.go
1 parent 6223c61 commit a6923c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

log/handler/file.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func NewFileHandler(filename string, level record.Level) *FileHandler {
3030
filenameFormat: "{filename}-{date}",
3131
dateFormat: "2006-01-02",
3232
}
33-
h.timedFilename = h.GetTimedFilename()
33+
// h.timedFilename = h.GetTimedFilename()
3434
return h
3535
}
3636

@@ -60,7 +60,7 @@ func (h *FileHandler) SetLevel(level record.Level) {
6060
func (h *FileHandler) write(r record.Record) {
6161
h.Lock()
6262
defer h.Unlock()
63-
file, _ := os.OpenFile(h.timedFilename, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0644)
63+
file, _ := os.OpenFile(h.GetTimedFilename(), os.O_RDWR|os.O_CREATE|os.O_APPEND, 0644)
6464
defer file.Close()
6565
file.Write([]byte(r.Formatted))
6666
}

0 commit comments

Comments
 (0)