Set ants logger

This commit is contained in:
CrazyMax
2020-05-27 23:08:39 +02:00
parent 4d0dba7572
commit 143a06b3eb
2 changed files with 10 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ import (
"github.com/crazy-max/diun/v3/internal/config"
"github.com/crazy-max/diun/v3/internal/db"
"github.com/crazy-max/diun/v3/internal/logging"
"github.com/crazy-max/diun/v3/internal/model"
"github.com/crazy-max/diun/v3/internal/notif"
dockerPrd "github.com/crazy-max/diun/v3/internal/provider/docker"
@@ -115,7 +116,7 @@ func (di *Diun) Run() {
Msg("Cannot run job")
}
di.wg.Done()
})
}, ants.WithLogger(new(logging.AntsLogger)))
defer di.pool.Release()
// Docker provider

View File

@@ -71,3 +71,11 @@ func (f *LogrusFormatter) Format(entry *logrus.Entry) ([]byte, error) {
}
return nil, nil
}
// AntsLogger is a logger for ants module
type AntsLogger struct{}
// Printf must have the same semantics as log.Printf
func (w *AntsLogger) Printf(format string, args ...interface{}) {
log.Debug().Msgf(format, args...)
}