canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.76k stars 642 forks source link

Small improvement: make --verbosity <level> case insensitive #3467

Closed nielsreijers closed 5 months ago

nielsreijers commented 6 months ago

What are you trying to do? To debug another issue, I wanted to set the --verbosity level to Debug.

The Logging levels page listed them with an initial capital, which didn't work because multipass wants the level in all small caps.

What's your proposed solution? Of course the mistake was easily found when multipassd failed to start, but wouldn't it be more user friendly if the parameter would ignore casing? It seems to me a simple .tolower() in the to_logging_level function in cli.cpp::34 should do the trick.

Additional context I'm new to multipass, and not an experienced C++ developer, so if there's good reason not to make this change, feel free to close the issue. I just thought it can potentially save future users a bit of time and frustration. Also, the 'Configure Multipass’s default logging level' page has just been updated to list the levels, and that page does list them in the correct small caps, so that already helps.

ricab commented 5 months ago

Hi @nielsreijers, thanks for the suggestion. I think what you propose makes sense. We'd welcome a patch for that, if you or someone else wants to contribute :)

nielsreijers commented 5 months ago

Hi @ricab. Ok, thanks for the quick response! :-) I'll submit a PR sometime later this week.

ricab commented 5 months ago

Great to hear, thank you @nielsreijers!