Skip to content

Commit

Permalink
Minor log fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mxpv committed Apr 23, 2020
1 parent 9f4f985 commit 8415f6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions cmd/podsync/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ func (u *Updater) downloadEpisodes(ctx context.Context, feedConfig *config.Feed)
if feedConfig.Filters.Title != "" {
matched, err := regexp.MatchString(feedConfig.Filters.Title, episode.Title)
if err != nil {
log.Warnf("Pattern '%s' is not a valid filter for %s Title", feedConfig.Filters.Title, feedConfig.ID)
log.Warnf("pattern %q is not a valid filter for %q Title", feedConfig.Filters.Title, feedConfig.ID)
} else {
if !matched {
log.Infof("Skipping '%s' due to lack of match with '%s'", episode.Title, feedConfig.Filters.Title)
log.Infof("skipping %q due to lack of match with %q", episode.Title, feedConfig.Filters.Title)
return nil
}
}
Expand All @@ -158,7 +158,7 @@ func (u *Updater) downloadEpisodes(ctx context.Context, feedConfig *config.Feed)
return nil
}

log.Debugf("adding %s (%q) to the list", episode.ID, episode.Title)
log.Debugf("adding %s (%q) to queue", episode.ID, episode.Title)
downloadList = append(downloadList, episode)
return nil
}); err != nil {
Expand Down Expand Up @@ -240,7 +240,6 @@ func (u *Updater) downloadEpisodes(ctx context.Context, feedConfig *config.Feed)
logger.WithError(err).Error("failed to copy file")
return err
}
logger.Debugf("copied %d bytes", fileSize)

// Update file status in database

Expand Down
2 changes: 1 addition & 1 deletion pkg/fs/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func NewLocal(rootDir string, hostname string) (*Local, error) {

func (l *Local) Create(ctx context.Context, ns string, fileName string, reader io.Reader) (int64, error) {
var (
logger = log.WithField("feed_id", ns).WithField("episode_id", fileName)
logger = log.WithField("episode_id", fileName)
feedDir = filepath.Join(l.rootDir, ns)
)

Expand Down

0 comments on commit 8415f6f

Please sign in to comment.