mirror of
https://github.com/navidrome/navidrome.git
synced 2026-05-03 06:51:16 +00:00
feat: add trace logging for plugin availability and error handling in agents
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
38d80a07de
commit
3b9d426c5c
@ -64,6 +64,7 @@ func (a *Agents) getEnabledAgentNames() []enabledAgent {
|
|||||||
if a.pluginLoader != nil {
|
if a.pluginLoader != nil {
|
||||||
availablePlugins = a.pluginLoader.PluginNames("MetadataAgent")
|
availablePlugins = a.pluginLoader.PluginNames("MetadataAgent")
|
||||||
}
|
}
|
||||||
|
log.Trace("Available MetadataAgent plugins", "plugins", availablePlugins)
|
||||||
|
|
||||||
configuredAgents := strings.Split(conf.Server.Agents, ",")
|
configuredAgents := strings.Split(conf.Server.Agents, ",")
|
||||||
|
|
||||||
@ -354,6 +355,9 @@ func (a *Agents) GetAlbumImages(ctx context.Context, name, artist, mbid string)
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
images, err := retriever.GetAlbumImages(ctx, name, artist, mbid)
|
images, err := retriever.GetAlbumImages(ctx, name, artist, mbid)
|
||||||
|
if err != nil {
|
||||||
|
log.Trace(ctx, "Agent GetAlbumImages failed", "agent", ag.AgentName(), "album", name, "artist", artist, "mbid", mbid, err)
|
||||||
|
}
|
||||||
if len(images) > 0 && err == nil {
|
if len(images) > 0 && err == nil {
|
||||||
log.Debug(ctx, "Got Album Images", "agent", ag.AgentName(), "album", name, "artist", artist,
|
log.Debug(ctx, "Got Album Images", "agent", ag.AgentName(), "album", name, "artist", artist,
|
||||||
"mbid", mbid, "elapsed", time.Since(start))
|
"mbid", mbid, "elapsed", time.Since(start))
|
||||||
|
|||||||
@ -583,6 +583,7 @@ func callPluginFunction[I any, O any](ctx context.Context, plugin *plugin, funcN
|
|||||||
defer p.Close(ctx)
|
defer p.Close(ctx)
|
||||||
|
|
||||||
if !p.FunctionExists(funcName) {
|
if !p.FunctionExists(funcName) {
|
||||||
|
log.Trace(ctx, "Plugin function not found", "plugin", plugin.name, "function", funcName)
|
||||||
return result, fmt.Errorf("%w: %s", errFunctionNotFound, funcName)
|
return result, fmt.Errorf("%w: %s", errFunctionNotFound, funcName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user