Run of fresh-releases for golang-github-rifflock-lfshook

Try this locally (using silver-platter):

debian-svp new-upstream golang-github-rifflock-lfshook 

Merge these changes:

Summary

Upstream version: 2.4.

Diff

diff --git a/README.md b/README.md
index 21675c6..ece313e 100644
--- a/README.md
+++ b/README.md
@@ -23,7 +23,7 @@ func NewLogger() *logrus.Logger {
 		logrus.ErrorLevel: "/var/log/error.log",
 	}
 
-	
+	Log = logrus.New()
 	Log.Hooks.Add(lfshook.NewHook(
 		pathMap,
 		&logrus.JSONFormatter{},
@@ -39,13 +39,13 @@ If no formatter is provided via `lfshook.NewHook`, a default text formatter will
 
 ### Log rotation
 In order to enable automatic log rotation it's possible to provide an io.Writer instead of the path string of a log file.
-In combination with pakages like [go-file-rotatelogs](https://github.com/lestrrat/go-file-rotatelogs) log rotation can easily be achieved.
+In combination with packages like [file-rotatelogs](https://github.com/lestrrat-go/file-rotatelogs) log rotation can easily be achieved.
 
 ```go
 package main
 
 import (
-	"github.com/lestrrat/go-file-rotatelogs"
+	rotatelogs "github.com/lestrrat-go/file-rotatelogs"
 	"github.com/rifflock/lfshook"
 	"github.com/sirupsen/logrus"
 )
@@ -58,7 +58,7 @@ func NewLogger() *logrus.Logger {
 	}
 
 	path := "/var/log/go.log"
-	writer := rotatelogs.NewRotateLogs(
+	writer := rotatelogs.New(
 		path+".%Y%m%d%H%M",
 		rotatelogs.WithLinkName(path),
 		rotatelogs.WithMaxAge(time.Duration(86400)*time.Second),
diff --git a/debian/changelog b/debian/changelog
index 67f6ca0..8b5281d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+golang-github-rifflock-lfshook (2.4-1) UNRELEASED; urgency=medium
+
+  * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Sun, 05 May 2019 01:19:50 +0000
+
 golang-github-rifflock-lfshook (2.2-1) unstable; urgency=medium
 
   [ Alexandre Viau ]
diff --git a/lfshook.go b/lfshook.go
index 50e4c03..1e8d22a 100644
--- a/lfshook.go
+++ b/lfshook.go
@@ -76,6 +76,8 @@ func NewHook(output interface{}, formatter logrus.Formatter) *LfsHook {
 // SetFormatter sets the format that will be used by hook.
 // If using text formatter, this method will disable color output to make the log file more readable.
 func (hook *LfsHook) SetFormatter(formatter logrus.Formatter) {
+	hook.lock.Lock()
+	defer hook.lock.Unlock()
 	if formatter == nil {
 		formatter = defaultFormatter
 	} else {
@@ -91,12 +93,16 @@ func (hook *LfsHook) SetFormatter(formatter logrus.Formatter) {
 
 // SetDefaultPath sets default path for levels that don't have any defined output path.
 func (hook *LfsHook) SetDefaultPath(defaultPath string) {
+	hook.lock.Lock()
+	defer hook.lock.Unlock()
 	hook.defaultPath = defaultPath
 	hook.hasDefaultPath = true
 }
 
 // SetDefaultWriter sets default writer for levels that don't have any defined writer.
 func (hook *LfsHook) SetDefaultWriter(defaultWriter io.Writer) {
+	hook.lock.Lock()
+	defer hook.lock.Unlock()
 	hook.defaultWriter = defaultWriter
 	hook.hasDefaultWriter = true
 }
@@ -104,6 +110,8 @@ func (hook *LfsHook) SetDefaultWriter(defaultWriter io.Writer) {
 // Fire writes the log file to defined path or using the defined writer.
 // User who run this function needs write permissions to the file or directory if the file does not yet exist.
 func (hook *LfsHook) Fire(entry *logrus.Entry) error {
+	hook.lock.Lock()
+	defer hook.lock.Unlock()
 	if hook.writers != nil || hook.hasDefaultWriter {
 		return hook.ioWrite(entry)
 	} else if hook.paths != nil || hook.hasDefaultPath {
@@ -122,9 +130,6 @@ func (hook *LfsHook) ioWrite(entry *logrus.Entry) error {
 		ok     bool
 	)
 
-	hook.lock.Lock()
-	defer hook.lock.Unlock()
-
 	if writer, ok = hook.writers[entry.Level]; !ok {
 		if hook.hasDefaultWriter {
 			writer = hook.defaultWriter
@@ -154,9 +159,6 @@ func (hook *LfsHook) fileWrite(entry *logrus.Entry) error {
 		ok   bool
 	)
 
-	hook.lock.Lock()
-	defer hook.lock.Unlock()
-
 	if path, ok = hook.paths[entry.Level]; !ok {
 		if hook.hasDefaultPath {
 			path = hook.defaultPath

Full worker log