Skip to content

Commit

Permalink
Auto flush logs to file per 3 seconds by default (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
mstmdev authored May 27, 2023
1 parent 4f89735 commit 6da419e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions file_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ type logMsg struct {
flush bool
}

// NewFileLogger get a file logger
// NewFileLogger get a default file logger, auto flush logs to file per 3 seconds by default
func NewFileLogger(lvl level.Level, logDir string, filePrefix string) (Logger, error) {
return NewFileLoggerWithAutoFlush(lvl, logDir, filePrefix, false, time.Duration(0))
return NewFileLoggerWithAutoFlush(lvl, logDir, filePrefix, true, time.Second*3)
}

// NewFileLoggerWithAutoFlush get a file logger
Expand Down

0 comments on commit 6da419e

Please sign in to comment.