Move from logrus to zerolog. ()

Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
This commit is contained in:
Antonio Navarro Perez 2021-03-10 10:54:56 +01:00 committed by GitHub
parent 2a38efbb03
commit 3b87e4aad7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 50 additions and 39 deletions
torrent

View file

@ -8,7 +8,7 @@ import (
"github.com/distribyted/distribyted/config"
"github.com/distribyted/distribyted/fs"
"github.com/distribyted/distribyted/stats"
log "github.com/sirupsen/logrus"
"github.com/rs/zerolog/log"
)
type Handler struct {
@ -49,14 +49,14 @@ func (s *Handler) Load(path string, ts []*config.Torrent) error {
// only get info if name is not available
if t.Name() == "" {
log.WithField("hash", t.InfoHash()).Info("getting torrent info")
log.Info().Str("hash", t.InfoHash().String()).Msg("getting torrent info")
<-t.GotInfo()
}
s.s.Add(path, t)
torrents = append(torrents, t)
log.WithField("name", t.Name()).WithField("path", path).Info("torrent added to mountpoint")
log.Info().Str("name", t.Name()).Str("path", path).Msg("torrent added to mountpoint")
}
folder := path