Better logging of GetSimilar call

This commit is contained in:
Deluan 2021-11-03 15:59:16 -04:00
parent 68a84ec832
commit d3a2f769b7
1 changed files with 5 additions and 1 deletions

View File

@ -107,7 +107,11 @@ func (a *Agents) GetSimilar(ctx context.Context, id, name, mbid string, limit in
}
similar, err := agent.GetSimilar(ctx, id, name, mbid, limit)
if len(similar) > 0 && err == nil {
log.Debug(ctx, "Got Similar Artists", "agent", ag.AgentName(), "artist", name, "similar", similar, "elapsed", time.Since(start))
if log.CurrentLevel() >= log.LevelTrace {
log.Debug(ctx, "Got Similar Artists", "agent", ag.AgentName(), "artist", name, "similar", similar, "elapsed", time.Since(start))
} else {
log.Debug(ctx, "Got Similar Artists", "agent", ag.AgentName(), "artist", name, "similarReceived", len(similar), "elapsed", time.Since(start))
}
return similar, err
}
}