Skip to content

Conversation

@JOJ0
Copy link
Member

@JOJ0 JOJ0 commented Sep 14, 2025

Description

Tuning log messages come in handy for instance when setting up personal whitelist and canonical files. Future lastgenre features will bring more of these messages, which might clutter the plugin's code as well as the DEBUG log. This PR adds a wrapper that only logs those messages when the user runs beet -vvv lastgenre ... (or beet -vvv import ...).

  • Documentation.
  • Changelog.
  • Tests.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Sep 14, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Introduce a centralized _debug_extended wrapper for conditional extended_debug logging and refactor existing debug calls to use it, streamlining debug output management in the lastgenre plugin.

Class diagram for updated logging in lastgenre plugin

classDiagram
    class LastGenrePlugin {
        +_debug_extended(msg, *args, **kwargs)
        _last_lookup(entity, method, *args)
        config
        _log
        _genre_cache
        fetch_genre()
        fetch_album_genre(obj)
        _load_whitelist() set[str]
        _load_c14n_tree()
        whitelist
        c14n_branches
        canonicalize
    }
    LastGenrePlugin : _debug_extended is new
    LastGenrePlugin : _last_lookup uses _debug_extended for logging
Loading

File-Level Changes

Change Details Files
Add _debug_extended wrapper method
  • Define _debug_extended under setup
  • Check config["extended_debug"] before logging
  • Call self._log.debug when enabled
beetsplug/lastgenre/__init__.py
Refactor debug calls to use the new wrapper
  • Remove direct config["extended_debug"] check in _last_lookup
  • Replace self._log.debug invocation with _debug_extended call
beetsplug/lastgenre/__init__.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions
Copy link

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

@JOJ0 JOJ0 marked this pull request as ready for review September 14, 2025 06:22
@JOJ0 JOJ0 requested a review from a team as a code owner September 14, 2025 06:22
Copilot AI review requested due to automatic review settings September 14, 2025 06:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a wrapper method to simplify extended debug logging in the lastgenre plugin. The change aims to reduce code clutter by centralizing conditional debug logging that is used when tuning whitelist and canonical files/settings.

  • Adds a _debug_extended helper method that conditionally logs debug messages based on the extended_debug configuration
  • Refactors existing extended debug logging to use the new wrapper method

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov
Copy link

codecov bot commented Sep 14, 2025

Codecov Report

❌ Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.98%. Comparing base (043581e) to head (4b1e505).
⚠️ Report is 4 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
beetsplug/lastgenre/__init__.py 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6007      +/-   ##
==========================================
- Coverage   66.98%   66.98%   -0.01%     
==========================================
  Files         118      118              
  Lines       18191    18192       +1     
  Branches     3079     3079              
==========================================
  Hits        12186    12186              
- Misses       5346     5347       +1     
  Partials      659      659              
Files with missing lines Coverage Δ
beetsplug/lastgenre/__init__.py 71.74% <25.00%> (-0.27%) ⬇️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JOJ0
Copy link
Member Author

JOJ0 commented Sep 14, 2025

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

Intentionally not added an entry. Dear @beetbox/maintainers tell me if you think I should add one. Otherwise I think this is a no-brainer. Thanks for a quick approval. I wasn't sure about the name of that wrapper method. There might be room for improvement but on the other hand it's not super-important how it's called.

@JOJ0 JOJ0 enabled auto-merge September 14, 2025 06:32
@JOJ0 JOJ0 force-pushed the lastgenre_ext_debug branch 3 times, most recently from 88fcbb4 to 1cc61d8 Compare September 16, 2025 05:16
@semohr
Copy link
Contributor

semohr commented Sep 16, 2025

Short question: What is the exact benefit for this over normal debug messages? In theory you can edit the loglevel for each child(plugin) logger separately. I.e. Set lastgenre to debug and everything else to info or warning.

If have not tested it, but I think something like this should work:

class TestPlugin(BeetsPlug):
    def __init__():
         super.init()
         self._log.setLevel("DEBUG") # Overwrite plugin logging

@JOJ0
Copy link
Member Author

JOJ0 commented Sep 16, 2025

Interesting, I've never heard about this possibility. I thought we are pretty stuck with the possibilities of info and debug log.

We see info logs while executing plugins directly

And debug only with -v

And during import we don't even see info logs

I thought that's kind of a fixed pattern we should follow

The actual purpose of this to get extensive debug logging to really be able to tune lastgenre settings/files (future features!) and this should only be available to those who want it / need it (configurable)

@JOJ0
Copy link
Member Author

JOJ0 commented Sep 17, 2025

Interesting, I've never heard about this possibility. I thought we are pretty stuck with the possibilities of info and debug log.

Let me rephrase: I know about loggers and levels and that I can change them but I kind of thought this is better not to be touched in beets and there is some thought/magic behind it.

In other words, do you think this usecase can be done with your idea: in short: "configurable additional logs":

The actual purpose of this to get extensive debug logging to really be able to tune lastgenre settings/files (future features!) and this should only be available to those who want it / need it (configurable)

And do I understand correctly? You are saying I could shift all logging "up one level"

info logs -> warning logs (actually the regular logs we see when running eg. beet lastgenre something)
debug logs > info logs
additional (extended) logs -> debug logs

and error logs stay error logs?
and fortuantely currently the plugin doesn't throw any warning level logs, so this is definitely an "unused" level ;-)

Before I start digging and since you were deep into the plugin ecosystem recently @semohr : Where actually is it decided/redirected that those info logs we see during explicit plugin execution are not shown during import?

This might all be dumb questions, but I never really questioned that it's an option in beets to fiddle with logging levels. Is something like this done anywhere else in beets yet?

@snejus
Copy link
Member

snejus commented Sep 17, 2025

There is no need to create a helper method if that method is called only once.

@semohr
Copy link
Contributor

semohr commented Sep 17, 2025

@JOJ0 Let quickly outline the requirements here as I'm a bit confused now:
You want to show some debug messages if a config option in lastgenre is enabled, while all other log messages are still only showing info and above? I got this right?

If yes, we should achieve that with a proper logging setup instead of a conditional. I had a look into the relevant code: At the moment each plugin creates a child logger. These loggers are assigned level 0 at the moment which might be the issue you are seeing when trying that.

I think a generic way to configure each child logger in beets (each plugins logging) would be the correct way to continue here, even though it will take more effort and will most likely need some slight changes in core. Something like -v [pluginnames] could work. Or we could allow loading a proper logging config file. This is for debugging purpose only anyways but could help triaging issues inside plugins quicker.

@snejus I think the function will be called more in the future and is just a preparation PR for more to come. This was a great choice imo as we can now properly talk about this one issue 👍

@JOJ0
Copy link
Member Author

JOJ0 commented Sep 17, 2025

@JOJ0 Let quickly outline the requirements here as I'm a bit confused now:

You want to show some debug messages if a config option in lastgenre is enabled, while all other log messages are still only showing info and above? I got this right?

I'll explain it with my current situation to hopefully avoid confusion:

I already use a lot of info and debug logs in the plugin. I want to be able to log even more debug logs but only when configured (or -d flag set). Let's call them super-verbose-debug logs.

@semohr
Copy link
Contributor

semohr commented Sep 17, 2025

I see now. Please dont take this the wrong way! Maybe it is time to rethink/refactor the logging than. I would normally not expect anyone to need more verbose logging than debug level 😆

In my view, logging here should mainly serve two purposes:
Info: Provide users with notifications about what’s happening. Most of the time it’s not critical, but occasionally it can be interesting or useful.
Debug: When issues arise, give users the ability to submit meaningful reports and give us enough detail to properly triage the problem.

If the debug logging is just for developing purpose maybe switching to pdb for debugging and using breakpoints might be more useful.

Of course this is subjective, so take it as you will, but to me, adding another debug level feels more like a workaround. A more maintainable approach might be to step back and reconsider whether all the existing logging is truly necessary in the first place.

@JOJ0
Copy link
Member Author

JOJ0 commented Sep 17, 2025

the logging is not for debugging/developing, it is for tuning the last.fm tree/whitelist/blacklist/aliases settings of lastgenre plugin users. we can't expect them to use pdb ore some kind of dev-centric tools.

maybe you can't see the full picture yet because most of these features dont exists yet?

I hope it's now more clear what the goal is here :-)

@semohr
Copy link
Contributor

semohr commented Sep 17, 2025

maybe you can't see the full picture yet because most of these features dont exists yet?

Very much possible!

Well if you feel like this is necessary I'm fine with approving it. Even though it seems a bit strange to me.

@JOJ0
Copy link
Member Author

JOJ0 commented Sep 17, 2025

There is no need to create a helper method if that method is called only once.

again: this is for the future features i'm working on!

i mentioned that here: #6007

@JOJ0
Copy link
Member Author

JOJ0 commented Sep 17, 2025

thank you @semohr yes I think this is the right way! Are you a lastgenre user yet?

@semohr
Copy link
Contributor

semohr commented Sep 17, 2025

thank you @semohr yes I think this is the right way! Are you a lastgenre user yet?

I haven't made some time yet to configure it properly for me. But it is on my todo list :)

@JOJ0
Copy link
Member Author

JOJ0 commented Sep 17, 2025

thank you @semohr yes I think this is the right way! Are you a lastgenre user yet?

I haven't made some time yet to configure it properly for me. But it is on my todo list :)

go ahead and dot it and maybe you will then better understand my reasoning here :-)

My personal opinion about this plugin is that it still does not have all the required features to really make it useful. last.fm is a beautiful but errorprone beast! you can't expect it to do the right thing always. it depends on how the user wants it. If we put everything that might be of relevance for that tuning, the already horribly unreadable beets log will have more last.tm logs than anything.

maybe I just named this option wrong and it should be called something like --tune-lastfm-logging or something? I can do that if we feel better that it does not imply that it got anything to do with a regular debug level logging?

@JOJ0
Copy link
Member Author

JOJ0 commented Sep 17, 2025

Since I still have the feeling that I need to explain myself better here. Even with the current version of the plugin, we see the urge for this extended logging option already:

This is an example for a various artists album. It is very interesting to see which things are considered during artist genre matching until a final artist genre can be decided on:

beet -vv -P smartplaylist,fetchart,vibenet lastgenre -a -K -d -f gilles peterson 2>&1 | grep lastgenre:
lastgenre: Loading whitelist /Users/jtiefenbacher/git/beets/beetsplug/lastgenre/genres.txt
lastgenre: Loading canonicalization tree ~/git/home_config/lastgenre_conf/genres-tree.yaml
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: ['samba', 'brazilian', 'brasil', 'mpb', 'latin', 'samba rock']
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: []
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: ['brazilian', 'female vocalists', 'world']
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: ['samba', 'jazz', 'brazilian']
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: []
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: ['samba', 'mpb', 'brazilian', 'bossa nova', 'brasil']
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: ['bossa nova', 'piano', 'jazz samba', 'brazil']
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: ['mpb', 'clube da esquina', 'brasil', 'brazil', 'brazilian']
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: ['samba', 'mpb', 'brazilian', 'brazil', 'brasil']
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: []
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: ['11']
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: ['dub', 'brazilian', 'dancehall']
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: []
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: ['lounge', 'bossa nova', 'chillout', 'downtempo', 'nu-jazz', 'nu jazz']
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: ['soul', 'jazz', 'funk', 'brazilian', 'mpb']
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: ['broken beat', 'nu jazz', 'electronica', 'electronic', 'jazz']
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: []
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: ['baile funk', 'brazilian']
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: ['beats', 'brasil', 'funk carioca']
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: ['drum and bass', 'liquid funk', 'brazilian']
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: ['latin', 'jazz', 'nu jazz', 'house']
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: ['hip-hop', 'instrumental hip-hop', 'underground hip-hop', 'stones throw', 'hip hop']
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: ['brazilian', 'brasil', 'latin jazz']
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) artist tags: ['jazz', 'brazil', 'latin jazz', 'brasil', 'brazilian']
lastgenre: Most popular track genre "brazilian" (12) for VA album.
lastgenre: raw last.fm tags: ['brazilian']
lastgenre: existing genres taken into account: []
lastgenre: genre for album "Gilles Peterson Back in Brazil" (fallback unconfigured): None
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: ['samba', 'brazilian', 'brasil', 'mpb', 'latin', 'samba rock']
lastgenre: raw last.fm tags: ['samba', 'brazilian', 'brasil', 'mpb', 'latin', 'samba rock']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Swinga Sambaby" (artist, whitelist): Samba, Mpb
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: []
lastgenre: No genre found for track "Samba do Carioca"
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: ['brazilian', 'female vocalists', 'world']
lastgenre: raw last.fm tags: ['brazilian', 'female vocalists', 'world']
lastgenre: existing genres taken into account: []
lastgenre: No genre found for track "Que Bandeira"
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: ['samba', 'jazz', 'brazilian']
lastgenre: raw last.fm tags: ['samba', 'jazz', 'brazilian']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "California Soul" (artist, whitelist): Samba, Jazz
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: []
lastgenre: No genre found for track "Procura se Uma Virgem"
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: ['samba', 'mpb', 'brazilian', 'bossa nova', 'brasil']
lastgenre: raw last.fm tags: ['samba', 'mpb', 'brazilian', 'bossa nova', 'brasil']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Lalari-Olala" (artist, whitelist): Samba, Mpb
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: ['bossa nova', 'piano', 'jazz samba', 'brazil']
lastgenre: raw last.fm tags: ['bossa nova', 'piano', 'jazz samba', 'brazil']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Reflexos" (artist, whitelist): Bossa Nova
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: ['mpb', 'clube da esquina', 'brasil', 'brazil', 'brazilian']
lastgenre: raw last.fm tags: ['mpb', 'clube da esquina', 'brasil', 'brazil', 'brazilian']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Homem de Rua" (artist, whitelist): Mpb
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: ['samba', 'mpb', 'brazilian', 'brazil', 'brasil']
lastgenre: raw last.fm tags: ['samba', 'mpb', 'brazilian', 'brazil', 'brasil']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Nana" (artist, whitelist): Samba, Mpb
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: []
lastgenre: No genre found for track "Tereza Guerreira"
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: ['11']
lastgenre: raw last.fm tags: ['11']
lastgenre: existing genres taken into account: []
lastgenre: No genre found for track "Cascavel"
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: ['dub', 'brazilian', 'dancehall']
lastgenre: raw last.fm tags: ['dub', 'brazilian', 'dancehall']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Calma Mamma (GP mix)" (artist, whitelist): Dub, Dancehall
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: []
lastgenre: No genre found for track "Zé Brasileiro"
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: ['lounge', 'bossa nova', 'chillout', 'downtempo', 'nu-jazz', 'nu jazz']
lastgenre: raw last.fm tags: ['lounge', 'bossa nova', 'chillout', 'downtempo', 'nu-jazz', 'nu jazz']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Beira Do Mar" (artist, whitelist): Bossa Nova, Chillout
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: ['soul', 'jazz', 'funk', 'brazilian', 'mpb']
lastgenre: raw last.fm tags: ['soul', 'jazz', 'funk', 'brazilian', 'mpb']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "E Muita Gig Vei (Mark de Clive-Lowe mix)" (artist, whitelist): Soul, Rhythm And Blues
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: ['broken beat', 'nu jazz', 'electronica', 'electronic', 'jazz']
lastgenre: raw last.fm tags: ['broken beat', 'nu jazz', 'electronica', 'electronic', 'jazz']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Sounds Like" (artist, whitelist): Broken Beat, Breakbeat
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: []
lastgenre: No genre found for track "A Pomba Girou"
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: ['baile funk', 'brazilian']
lastgenre: raw last.fm tags: ['baile funk', 'brazilian']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Sex-O-Matic (Solid Groove remix)" (artist, whitelist): Baile Funk
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: ['beats', 'brasil', 'funk carioca']
lastgenre: raw last.fm tags: ['beats', 'brasil', 'funk carioca']
lastgenre: existing genres taken into account: []
lastgenre: No genre found for track "Cleck Cleck Boom"
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: ['drum and bass', 'liquid funk', 'brazilian']
lastgenre: raw last.fm tags: ['drum and bass', 'liquid funk', 'brazilian']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Baby" (artist, whitelist): Drum And Bass, Liquid Funk
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: ['latin', 'jazz', 'nu jazz', 'house']
lastgenre: raw last.fm tags: ['latin', 'jazz', 'nu jazz', 'house']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Aquilas Coisas Todas" (artist, whitelist): Jazz, Nu Jazz
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: ['hip-hop', 'instrumental hip-hop', 'underground hip-hop', 'stones throw', 'hip hop']
lastgenre: raw last.fm tags: ['hip-hop', 'instrumental hip-hop', 'underground hip-hop', 'stones throw', 'hip hop']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Ritmo Suave Bossa Nova" (artist, whitelist): Hip Hop
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: ['brazilian', 'brasil', 'latin jazz']
lastgenre: raw last.fm tags: ['brazilian', 'brasil', 'latin jazz']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Vaga Lume" (artist, whitelist): Latin Jazz, Jazz
lastgenre: last.fm (unfiltered) track tags: []
lastgenre: last.fm (unfiltered) album tags: []
lastgenre: last.fm (unfiltered) artist tags: ['jazz', 'brazil', 'latin jazz', 'brasil', 'brazilian']
lastgenre: raw last.fm tags: ['jazz', 'brazil', 'latin jazz', 'brasil', 'brazilian']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Urubú Jazz (Super Jazz Carnaval 06 remix)" (artist, whitelist): Jazz, Latin Jazz

now if we do the same without the extended_debug option enabled, the lastgenre plugin returns to just being a blackbox but on the other hand, if we are fine with that outcome, the log is not polluted as we just saw above:

lastgenre: Loading whitelist /Users/jtiefenbacher/git/beets/beetsplug/lastgenre/genres.txt
lastgenre: Loading canonicalization tree ~/git/home_config/lastgenre_conf/genres-tree.yaml
lastgenre: Most popular track genre "brazilian" (12) for VA album.
lastgenre: raw last.fm tags: ['brazilian']
lastgenre: existing genres taken into account: []
lastgenre: genre for album "Gilles Peterson Back in Brazil" (fallback unconfigured): None
lastgenre: raw last.fm tags: ['samba', 'brazilian', 'brasil', 'mpb', 'latin', 'samba rock']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Swinga Sambaby" (artist, whitelist): Samba, Mpb
lastgenre: No genre found for track "Samba do Carioca"
lastgenre: raw last.fm tags: ['brazilian', 'female vocalists', 'world']
lastgenre: existing genres taken into account: []
lastgenre: No genre found for track "Que Bandeira"
lastgenre: raw last.fm tags: ['samba', 'jazz', 'brazilian']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "California Soul" (artist, whitelist): Samba, Jazz
lastgenre: No genre found for track "Procura se Uma Virgem"
lastgenre: raw last.fm tags: ['samba', 'mpb', 'brazilian', 'bossa nova', 'brasil']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Lalari-Olala" (artist, whitelist): Samba, Mpb
lastgenre: raw last.fm tags: ['bossa nova', 'piano', 'jazz samba', 'brazil']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Reflexos" (artist, whitelist): Bossa Nova
lastgenre: raw last.fm tags: ['mpb', 'clube da esquina', 'brasil', 'brazil', 'brazilian']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Homem de Rua" (artist, whitelist): Mpb
lastgenre: raw last.fm tags: ['samba', 'mpb', 'brazilian', 'brazil', 'brasil']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Nana" (artist, whitelist): Samba, Mpb
lastgenre: No genre found for track "Tereza Guerreira"
lastgenre: raw last.fm tags: ['11']
lastgenre: existing genres taken into account: []
lastgenre: No genre found for track "Cascavel"
lastgenre: raw last.fm tags: ['dub', 'brazilian', 'dancehall']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Calma Mamma (GP mix)" (artist, whitelist): Dub, Dancehall
lastgenre: No genre found for track "Zé Brasileiro"
lastgenre: raw last.fm tags: ['lounge', 'bossa nova', 'chillout', 'downtempo', 'nu-jazz', 'nu jazz']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Beira Do Mar" (artist, whitelist): Bossa Nova, Chillout
lastgenre: raw last.fm tags: ['soul', 'jazz', 'funk', 'brazilian', 'mpb']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "E Muita Gig Vei (Mark de Clive-Lowe mix)" (artist, whitelist): Soul, Rhythm And Blues
lastgenre: raw last.fm tags: ['broken beat', 'nu jazz', 'electronica', 'electronic', 'jazz']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Sounds Like" (artist, whitelist): Broken Beat, Breakbeat
lastgenre: No genre found for track "A Pomba Girou"
lastgenre: raw last.fm tags: ['baile funk', 'brazilian']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Sex-O-Matic (Solid Groove remix)" (artist, whitelist): Baile Funk
lastgenre: raw last.fm tags: ['beats', 'brasil', 'funk carioca']
lastgenre: existing genres taken into account: []
lastgenre: No genre found for track "Cleck Cleck Boom"
lastgenre: raw last.fm tags: ['drum and bass', 'liquid funk', 'brazilian']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Baby" (artist, whitelist): Drum And Bass, Liquid Funk
lastgenre: raw last.fm tags: ['latin', 'jazz', 'nu jazz', 'house']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Aquilas Coisas Todas" (artist, whitelist): Jazz, Nu Jazz
lastgenre: raw last.fm tags: ['hip-hop', 'instrumental hip-hop', 'underground hip-hop', 'stones throw', 'hip hop']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Ritmo Suave Bossa Nova" (artist, whitelist): Hip Hop
lastgenre: raw last.fm tags: ['brazilian', 'brasil', 'latin jazz']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Vaga Lume" (artist, whitelist): Latin Jazz, Jazz
lastgenre: raw last.fm tags: ['jazz', 'brazil', 'latin jazz', 'brasil', 'brazilian']
lastgenre: existing genres taken into account: []
lastgenre: genre for item "Urubú Jazz (Super Jazz Carnaval 06 remix)" (artist, whitelist): Jazz, Latin Jazz

So to summarize this in numbers, the extended debug log version consists of 189 lines (!) and contains what we actually get from last.fm - this is very important information if you want to know what to write into your whitelist and canonicalzation files!

The "normal" version only contains 68 lines.

I hope I coudl give you a better understanding now, why I think this additional level of information is useful for users but should not go into the general debug log - it is just too much!

@semohr
Copy link
Contributor

semohr commented Sep 17, 2025

Makes sense! Just to throw yet another idea in here. How about creating another child logger for this information? This way it is also easier to filter it? And you can set the log level with a config option in the lastgenre plugin?

tunelog = self._log.getChild("tuning")
tunelog.setLevel(config)

@snejus
Copy link
Member

snejus commented Oct 8, 2025

I'm cherry-picking a couple of bits and pieces from this convo

@JOJ0

And during import we don't even see info logs

We see the same logs during the import (as long as we provide -vv to the command)

$ beet -vv import -LI album:'Signs of a struggle'
user configuration: /home/sarunas/.config/beets/config.yaml
data directory: /home/sarunas/.config/beets
plugin paths: []
Loading plugins: autobpm, bandcamp, bareasc, bench, deezer, discogs, edit, embedart, fetchart, importreplace, info, inline, lastgenre, lastimport, lyrics, mbcollection, mbsync, missing, mpdstats, mpdupdate, musicbrainz, random, replaygain, scrub, spotify, types, unimported
fetchart: google: Disabling art source due to missing key
inline: adding item field has_lyrics
inline: adding item field label_or_albumartist
inline: adding item field singleton_track_artist
inline: adding item field track_artist
inline: adding item field album_name
inline: adding item field track_identification
inline: adding item field withdrawn
inline: adding album field label_or_albumartist
inline: adding album field multiple_artists
lastgenre: Loading whitelist /home/sarunas/repo/beets/beetsplug/lastgenre/genres.txt
lastgenre: Loading canonicalization tree /home/sarunas/repo/beets/beetsplug/lastgenre/genres-tree.yaml
Sending event: pluginload
library database: /home/sarunas/.music/beets/library.db
library directory: /run/media/sarunas/music/Music
Sending event: library_opened
Sending event: import_begin
Parsed query: AndQuery([SubstringQuery('album', 'Signs of a struggle', fast=True)])
Parsed sort: NullSort()
yielding album 12090: Mattafix - Signs of a Struggle
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_start
Looking up: /run/media/sarunas/music/Music/emiinternational/mattafix_signsofastruggle/02_bigcitylife.mp3
Tagging Mattafix - Signs of a Struggle
Searching for discovered album ID: 4a6d6b9b-02f8-413c-a672-9bbe535b36d8
bandcamp: Not a bandcamp URL, skipping
deezer: Deezer API error: no data
discogs: Searching for release 4a6d6b9b-02f8-413c-a672-9bbe535b36d8
musicbrainz: Requesting MusicBrainz release 4a6d6b9b-02f8-413c-a672-9bbe535b36d8
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_album_extract
Sending event: albuminfo_received
Candidate: Mattafix - Signs of a Struggle (4a6d6b9b-02f8-413c-a672-9bbe535b36d8)
Computing track assignment...
...done.
Success. Distance: 0.00
Album ID match recommendation is 3
Search terms: Mattafix - Signs of a Struggle
Album might be VA: False
bandcamp: Searching releases for Mattafix - Signs of a Struggle
deezer: Searching Deezer for 'album:'Signs of a Struggle' artist:'Mattafix''
deezer: Found 1 result(s) from Deezer for 'album:'Signs of a Struggle' artist:'Mattafix''
Sending event: albuminfo_received
Candidate: Mattafix - Signs Of A Struggle (678437231)
Computing track assignment...
...done.
Success. Distance: 0.41
discogs: Getting master release 103390
Sending event: albuminfo_received
Candidate: Mattafix - Signs Of A Struggle (1616194)
Computing track assignment...
...done.
Success. Distance: 0.32
spotify: Searching Spotify for 'album:'Signs of a Struggle' artist:'Mattafix''
spotify: Found 1 result(s) from Spotify for 'album:'Signs of a Struggle' artist:'Mattafix''
Sending event: albuminfo_received
Candidate: Mattafix - Signs Of A Struggle (57m6FbCoUXfTxw6REFc3RZ)
Computing track assignment...
...done.
Success. Distance: 0.30
musicbrainz: Searching for MusicBrainz releases with: {'release': 'signs of a struggle', 'alias': 'signs of a struggle', 'tracks': '1', 'artist': 'mattafix'}
musicbrainz: Requesting MusicBrainz release bb64608d-e2cf-42ec-b06b-c0239774536e
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
musicbrainz: Found link to Discogs release via MusicBrainz
Sending event: mb_album_extract
Sending event: albuminfo_received
Candidate: Mattafix - Signs of a Struggle (bb64608d-e2cf-42ec-b06b-c0239774536e)
Computing track assignment...
...done.
Success. Distance: 0.28
Evaluating 5 candidates.

/run/media/sarunas/music/Music/emiinternational/mattafix_signsofastruggle/02_bigcitylife.mp3 (1 items)
Sending event: import_task_before_choice
Sending event: before_choose_candidate

Match (100.0%):
Mattafix - Signs of a Struggle
MusicBrainz, Mattafix, Signs of a Struggle, CD, 2005, 10, 30, None, EMI International, album, Official, US, downtempo; electro; electronic; hip hop; ragga hip-hop; reggae; trip hop; alternative hip hop; r&b; urban crossover
https://musicbrainz.org/release/4a6d6b9b-02f8-413c-a672-9bbe535b36d8

  • Artist: Mattafix
  • Album: Signs of a Struggle
    • (#2) Big City Life (4:00)
      Missing tracks (13/14 - 92.9%):
      ! Gangster Blues (#1) (4:19)
      ! Passer By (#3) (3:33)
      ! To & Fro (#4) (4:04)
      ! Everyone Around You (#5) (4:58)
      ! Clear and Present Danger (#6) (4:20)
      ! Older (#7) (2:50)
      ! I to You (#8) (4:21)
      ! Impartial (#9) (3:55)
      ! The Means (#10) (4:09)
      ! 11.30 (#11) (3:28)
      ! The Forgotten (#12) (3:52)
      ! 555 (#13) (6:33)
      ! Cool Down the Pace (#14) (7:02)
      ➜ [A]pply, More candidates, Skip, Use as-is, as Tracks, Group albums,
      Enter search, enter Id, aBort, eDit, edit Candidates?

Sending event: import_task_choice
Sending event: import_task_apply
Replacing item 56829: /run/media/sarunas/music/Music/emiinternational/mattafix_signsofastruggle/02_bigcitylife.mp3
Sending event: database_change
Sending event: database_change
Sending event: album_removed
Sending event: item_removed
1 of 1 items replaced
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Reimported album 12090. Preserving attribute ['added']. Path: /run/media/sarunas/music/Music/emiinternational/mattafix_signsofastruggle
Reimported album 12090. Preserving flexible attributes ['data_source', 'media']. Path: /run/media/sarunas/music/Music/emiinternational/mattafix_signsofastruggle
Reimported item 56829. Preserving attribute ['added']. Path: /run/media/sarunas/music/Music/emiinternational/mattafix_signsofastruggle/02_bigcitylife.mp3
Reimported item 56829. Preserving flexible attributes ['track_alt', 'data_source', 'art_source', 'play_count', 'artpath', 'rating', 'last_played']. Path: /run/media/sarunas/music/Music/emiinternational/mattafix_signsofastruggle/02_bigcitylife.mp3
Sending event: database_change
lastgenre: genre for album "Signs of a Struggle" (keep any, no-force): downtempo; electro; electronic; hip hop; ragga hip-hop; reggae; trip hop; alternative hip hop; r&b; urban crossover
Sending event: database_change
lastgenre: genre for track "Big City Life" (keep any, no-force): downtempo; electro; electronic; hip hop; ragga hip-hop; reggae; trip hop; alternative hip hop; r&b; urban crossover
Sending event: database_change
Parsed query: AndQuery([SubstringQuery('albumtype', 'broadcast', fast=True)])
Parsed sort: NullSort()
Parsed query: AndQuery([NoneQuery('album_id', True)])
Parsed sort: NullSort()
Parsed query: AndQuery([BooleanQuery('comp', 1, fast=True)])
Parsed sort: NullSort()
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: import_task_files
Sending event: album_imported
Sending event: import
Sending event: cli_exit
mpdupdate: Updating MPD database...
mpdupdate: Database updated.

@JOJ0

I already use a lot of info and debug logs in the plugin. I want to be able to log even more debug logs but only when configured (or -d flag set). Let's call them super-verbose-debug logs.

It's fine to use debug to log 'even more' debugging information. If the extra debugging output is made to only be present when -d flag is provided to the lastgenre command, it will not be present when I run beet import. I expect -vv flag in beet -vv import to reveal all debugging output.

Ultimately, the issue I have has to do with consistency - we want all plugins to behave consistently.

@JOJ0
Copy link
Member Author

JOJ0 commented Oct 9, 2025

Good, then I'd like to revert this back to my initial idea: 2c35307

That ok with both of you? @semohr @snejus

@JOJ0
Copy link
Member Author

JOJ0 commented Oct 9, 2025

And during import we don't even see info logs

We see the same logs during the import (as long as we provide -vv to the command)

$ beet -vv import -LI album:'Signs of a struggle'

@snejus I'm pretty sure that you know... that I know.... that .... :lol:

Reading thru the context here, I probably ment that we don't see it during a regular import (no -v's given). LOL again!

@snejus
Copy link
Member

snejus commented Oct 9, 2025

@snejus I'm pretty sure that you know... that I know.... that .... :lol:

Can never be sure! Well, only yesterday I learned that for some reason one needs to provide double v to the beet -vv import command to see lastgenre debug logs. Meanwhile, only a single v is required in beet -v lastgenre command to see the same logs 🤷🏼 .

@JOJ0 JOJ0 force-pushed the lastgenre_ext_debug branch 2 times, most recently from 2c35307 to 9573432 Compare October 10, 2025 05:01
@JOJ0
Copy link
Member Author

JOJ0 commented Oct 10, 2025

@snejus I'm pretty sure that you know... that I know.... that .... :lol:

Can never be sure! Well, only yesterday I learned that for some reason one needs to provide double v to the beet -vv import command to see lastgenre debug logs. Meanwhile, only a single v is required in beet -v lastgenre command to see the same logs 🤷🏼 .

Fair enough! I have to admit that only now that you say it, I did kind of knew that, or at least I had known that once 🤣 but definitely forgot the details and needed this reminder. Yes this is something I always found a bit awkward.

What I learned during this additional logger experiment is that generally python loggers spit out on stderr by default. At first I found the idea very tempting that I could redirect this additional logger to stdout to simplify filtering with grep (which otherwise requires the tedious 2>&1 syntax to those logs). I then realized that to make it really usable and see the picture I want, I also need the regular INFO and DEBUG logs. So I have to redirect that as well. Or somehow double those logs by redirecting them into the additional logger.

So in short this is all too complicated and yes I agree we would access plugin-territorry that might not be expected and streamlined behavior anymore.

So yes please, let's go back to a simple solution. I deleted my experiments, went back to the initial solution (also no renaming of the option/config) and rebased with current master.

Copy link
Contributor

@semohr semohr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for derailing this a bit. Thought there might be a better way 🙃

We may want to have a look at our logging setup in general tho. There might be some room for improvements, e.g. setting logging levels for plugins could be a bit more configurable.

@snejus
Copy link
Member

snejus commented Oct 10, 2025

which otherwise requires the tedious 2>&1 syntax

Try |&

@snejus
Copy link
Member

snejus commented Oct 10, 2025

Note that the problem I described is still present:

I expect -vv flag in beet -vv import to reveal all debugging output.

@JOJ0
Copy link
Member Author

JOJ0 commented Oct 12, 2025

Note that the problem I described is still present:

I expect -vv flag in beet -vv import to reveal all debugging output.

if extended_debug is enabled in the config you see it.

@JOJ0
Copy link
Member Author

JOJ0 commented Oct 13, 2025

Note that the problem I described is still present:

I expect -vv flag in beet -vv import to reveal all debugging output.

if extended_debug is enabled in the config you see it.

I'd like to add:

In that sense I'm understanding it to be consistent and expected plugin behavior. Think about it in general:

  • User sets a config for a plugin
  • The logging output of the plugin changes according to the configuration that is set.

Does that help @snejus?

@snejus
Copy link
Member

snejus commented Oct 13, 2025

But why adding this extra step? And why lastgenre requires special treatment? No other plugin (as far as I'm aware) has such configuration option.

When I use -vv flag I just want to see it all - show me everything that can possibly be debugged. I don't want to also ensure that this configuration option is set.

What prevents you from including this extra debugging output as part of the normal debugging logs?

@JOJ0
Copy link
Member Author

JOJ0 commented Oct 13, 2025

But why adding this extra step? And why lastgenre requires special treatment? No other plugin (as far as I'm aware) has such configuration option.

When I use -vv flag I just want to see it all - show me everything that can possibly be debugged. I don't want to also ensure that this configuration option is set.

What prevents you from including this extra debugging output as part of the normal debugging logs?

Dear @snejus, we are running in circles here. Please read the why's I already posted a while ago repeatedly. @semhor linked it for you. I think I explained in detail already why I don't think it's a good idea to include all this in the regular log. Please try to find the time to read again. Many thanks! Let's get back to being productive. Please! Thank you! I'll do you the favor and post it again. Start reading here: #6007 (comment) Thank you very much!

@JOJ0
Copy link
Member Author

JOJ0 commented Oct 13, 2025

The extended_debug setting or -d flag comes in handy when tuning personal whitelist and canonical files/settings. Future lastgenre features will bring more of these messages, which might clutter the plugin's code. This is a simple wrapper to make these log messages a little less obvious.

@snejus
Copy link
Member

snejus commented Oct 13, 2025

OK, an idea: what about checking the global level, i.e., the number of v's given for the verbose option in beet -v ... command? This seems to address both of our worries.

See

class LastGenrePlugin(plugins.BeetsPlugin):
    def __init__(self):
        print(" --- VERBOSITY --- ")
        print(config["verbose"].as_number())
        print(" --- --------- --- ")
$ beet lastgenre index::100000
 --- VERBOSITY --- 
0
 --- --------- --- 
$ beet -v lastgenre index::100000
user configuration: /home/sarunas/.config/beets/config.yaml
data directory: /home/sarunas/.config/beets
plugin paths: []
Loading plugins: autobpm, bandcamp, bareasc, bench, deezer, discogs, edit, embedart, fetchart, importreplace, info, inline, lastgenre, lastimport, lyrics, mbcollection, mbsync, missing, mpdstats, mpdupdate, musicbrainz, random, replaygain, scrub, spotify, types, unimported
fetchart: google: Disabling art source due to missing key
inline: adding item field has_lyrics
inline: adding item field label_or_albumartist
inline: adding item field singleton_track_artist
inline: adding item field track_artist
inline: adding item field album_name
inline: adding item field track_identification
inline: adding item field withdrawn
inline: adding album field label_or_albumartist
inline: adding album field multiple_artists
 --- VERBOSITY --- 
1
 --- --------- --- 
lastgenre: Loading whitelist /home/sarunas/repo/beets/beetsplug/lastgenre/genres.txt
lastgenre: Loading canonicalization tree /home/sarunas/repo/beets/beetsplug/lastgenre/genres-tree.yaml
Sending event: pluginload
library database: /home/sarunas/.music/beets/library.db
library directory: /run/media/sarunas/music/Music
Sending event: library_opened
Parsed query: AndQuery([RegexpQuery('index', re.compile('100000'), fast=False)])
Parsed sort: NullSort()
Sending event: cli_exit
$ beet -vv lastgenre index::100000
user configuration: /home/sarunas/.config/beets/config.yaml
data directory: /home/sarunas/.config/beets
plugin paths: []
Loading plugins: autobpm, bandcamp, bareasc, bench, deezer, discogs, edit, embedart, fetchart, importreplace, info, inline, lastgenre, lastimport, lyrics, mbcollection, mbsync, missing, mpdstats, mpdupdate, musicbrainz, random, replaygain, scrub, spotify, types, unimported
fetchart: google: Disabling art source due to missing key
inline: adding item field has_lyrics
inline: adding item field label_or_albumartist
inline: adding item field singleton_track_artist
inline: adding item field track_artist
inline: adding item field album_name
inline: adding item field track_identification
inline: adding item field withdrawn
inline: adding album field label_or_albumartist
inline: adding album field multiple_artists
 --- VERBOSITY --- 
2
 --- --------- --- 
lastgenre: Loading whitelist /home/sarunas/repo/beets/beetsplug/lastgenre/genres.txt
lastgenre: Loading canonicalization tree /home/sarunas/repo/beets/beetsplug/lastgenre/genres-tree.yaml
Sending event: pluginload
library database: /home/sarunas/.music/beets/library.db
library directory: /run/media/sarunas/music/Music
Sending event: library_opened
Parsed query: AndQuery([RegexpQuery('index', re.compile('100000'), fast=False)])
Parsed sort: NullSort()
^[[A^[[DSending event: cli_exit
$ beet -vvv lastgenre index::100000
user configuration: /home/sarunas/.config/beets/config.yaml
data directory: /home/sarunas/.config/beets
plugin paths: []
Loading plugins: autobpm, bandcamp, bareasc, bench, deezer, discogs, edit, embedart, fetchart, importreplace, info, inline, lastgenre, lastimport, lyrics, mbcollection, mbsync, missing, mpdstats, mpdupdate, musicbrainz, random, replaygain, scrub, spotify, types, unimported
fetchart: google: Disabling art source due to missing key
inline: adding item field has_lyrics
inline: adding item field label_or_albumartist
inline: adding item field singleton_track_artist
inline: adding item field track_artist
inline: adding item field album_name
inline: adding item field track_identification
inline: adding item field withdrawn
inline: adding album field label_or_albumartist
inline: adding album field multiple_artists
 --- VERBOSITY --- 
3
 --- --------- --- 
lastgenre: Loading whitelist /home/sarunas/repo/beets/beetsplug/lastgenre/genres.txt
lastgenre: Loading canonicalization tree /home/sarunas/repo/beets/beetsplug/lastgenre/genres-tree.yaml
Sending event: pluginload
library database: /home/sarunas/.music/beets/library.db
library directory: /run/media/sarunas/music/Music
Sending event: library_opened
Parsed query: AndQuery([RegexpQuery('index', re.compile('100000'), fast=False)])
Parsed sort: NullSort()
Sending event: cli_exit

@snejus
Copy link
Member

snejus commented Oct 13, 2025

@JOJ0 I understand your frustration, but I hope you can appreciate that this PR has grown quite lengthy with extensive discussion across multiple threads. When I asked my questions, I was looking for a concise summary of the core technical justification rather than having to parse through all the detailed examples and back-and-forth.

I found your response dismissive when you suggested I hadn't taken the time to read your explanations. As a maintainer, I need to efficiently evaluate PRs, and asking for focused clarification is part of that process - not a sign of laziness or inattention.

I've now provided a technical alternative using config["verbose"].as_number() >= 3 to check for -vvv flag, which would address your volume concerns while using existing beets infrastructure.

Let's focus on evaluating the technical merits of both approaches constructively. I'm genuinely trying to help find the best solution here.

@JOJ0
Copy link
Member Author

JOJ0 commented Oct 16, 2025

@JOJ0 I understand your frustration, but I hope you can appreciate that this PR has grown quite lengthy with extensive discussion across multiple threads. When I asked my questions, I was looking for a concise summary of the core technical justification rather than having to parse through all the detailed examples and back-and-forth.

The justification is not technical but organizational and I posted it initially in the PR's description (which I just posted and highlighted the words that are important again):

#6007 (comment)

and @semohr pointed you to relevant parts of the thread recently:

#6007 (comment)

I found your response dismissive when you suggested I hadn't taken the time to read your explanations. As a maintainer, I need to efficiently evaluate PRs, and asking for focused clarification is part of that process - not a sign of laziness or inattention.

Ok sorry but I felt ignored here 🤷 since what I wrote above ^^^ . Re-explaining again felt like useless work since I did that repeatedly already. Sorry, maybe a misunderstanding and nevermind. Let's move on with your suggestion....

I've now provided a technical alternative using config["verbose"].as_number() >= 3 to check for -vvv flag, which would address your volume concerns while using existing beets infrastructure.

I like your suggestion. Let's try that...

Copy link
Member

@snejus snejus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great - it seems there's a conflict (probably to do with the changes I merged earlier). You're good to go once that's resolved

@JOJ0 JOJ0 changed the title lastgenre: Wrap extended_debug log method lastgenre: Plugin tuning log (-vvv) Oct 23, 2025
JOJ0 added a commit that referenced this pull request Oct 23, 2025
@JOJ0 JOJ0 force-pushed the lastgenre_ext_debug branch from 05625f6 to bd04f0b Compare October 23, 2025 06:00
@JOJ0 JOJ0 force-pushed the lastgenre_ext_debug branch from bd04f0b to 4b1e505 Compare October 23, 2025 17:03
Copy link
Member

@snejus snejus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@JOJ0 JOJ0 merged commit 201677a into master Oct 25, 2025
21 checks passed
@JOJ0 JOJ0 deleted the lastgenre_ext_debug branch October 25, 2025 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants