mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.83k stars 2.93k forks source link

Is --msg-level a candiate for list option syntax? #11760

Open catcake opened 1 year ago

catcake commented 1 year ago

Currently, --msg-level can only be set like this:

msg-level=all=warn,autoload=warn,cat_ntap=trace

IMO, it would be more ergonomic to set it using the list option syntax, like this:

msg-level=all=warn
msg-levels-append=autoload=warn
msg-levels-append=cat_ntap=trace

It might add confusion, however, the ordering of module/level pairs in --msg-level already matters (e.g. in msg-level=cat_watch_history=trace,all=fatal, cat_watch_history=trace is overridden by all=fatal) and this is already stated in the manual:

Key/value list options A key/value list is a list of key/value string pairs. In programming languages, this type of data structure is often called a map or a dictionary. The order normally does not matter, although in some cases the order might matter.

Is there a reason why --msg-level doesn't support this syntax? Has it simply never been added? If this is the only barrier, I don't mind submitting a pull request with this functionality.

Traneptora commented 1 year ago

As far as I'm aware there's no technical reason this can't happen. If you'd like to submit a PR to add this functionality, feel free.