Skip to content

Commit

Permalink
Update file.go
Browse files Browse the repository at this point in the history
  • Loading branch information
leeqvip authored May 7, 2019
1 parent 6223c61 commit a6923c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions log/handler/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func NewFileHandler(filename string, level record.Level) *FileHandler {
filenameFormat: "{filename}-{date}",
dateFormat: "2006-01-02",
}
h.timedFilename = h.GetTimedFilename()
// h.timedFilename = h.GetTimedFilename()
return h
}

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

0 comments on commit a6923c9

Please sign in to comment.