@cryptotaxi247 / kubo / commits / 5c0403c6e

eventlog: buffer writes before pushing them to lumberjack - same effect, no upstream changes. Thx @natefinch!

Henry committed Apr 30, 2015 at 13:33 UTC 5c0403c6ef07a1db7fc0bf12ba56c2626e112312
1 file changed +3 -2
thirdparty/eventlog/option.go
+3 -2
@@ -1,6 +1,7 @@
1 package eventlog
2
3 import (
4 + "bufio"
5 "io"
6 "os"
7
@@ -53,12 +54,12 @@ func Output(w io.Writer) Option {
54 func OutputRotatingLogFile(config LogRotatorConfig) Option {
55 return func() {
56 logrus.SetOutput(
56 - &lumberjack.Logger{
57 + bufio.NewWriter(&lumberjack.Logger{
58 Filename: config.Filename,
59 MaxSize: int(config.MaxSizeMB),
60 MaxBackups: int(config.MaxBackups),
61 MaxAge: int(config.MaxAgeDays),
61 - })
62 + }))
63 }
64 }
65