How can I store the logs which are coming from GoWorkers (docs) into a file. I show that there is a WorkersLogger
interface but I don't understand how to use it.
At the moment I have this:
func main() {
workers.Configure(map[string]string)
workers.Middleware.Append(&midRetry{})
workers.Process("imp", worker.InitJob, 30)
workers.Run()
}
type midRetry struct{}
func (r *midRetry) Call(queue string, message *workers.Msg, next func() bool) (acknowledge bool) {
acknowledge = next()
return
}
I was thinking in creating a chan string
in the midRetry struct, and inside Call send messages on the channel, and receive them in main, and then write them to file, but I feel that there is a better way.