Very confusing --verbosity and --verbose behavior (depends on base!) in Snapcraft 7

The topic may sound minor but since Snapcraft decided to suppress logs by default in its new version (request to revert that in LP:2020892) it is quite relevant.

I can synthesize the issue in the following table:

flag core20 core22
--verbose logs no logs
--verbosity=debug error logs

This table has yet another dimension, namely “Snapcraft version”. The result is stark confusion and a hit-and-miss approach to building snaps.


On core20, snapcraft 7.3.2, --verbosity fails despite being present in the help page.

% snapcraft --debug --verbosity=trace --use-lxd
...
Error: No such option: --verbosity (Possible options: --verbose, --version)

--verbose works.


On core22, snapcraft 7.3.2, --verbose is accepted but has no or limited effect, insofar as full logs aren’t present. --verbosity is the right choice instead.


What does snapcraft build --help have to say?

-v, --verbose:  Show debug information and be
                more verbose
  -q, --quiet:  Only show warnings and errors,
                not progress
  --verbosity:  Set the verbosity level to
                'quiet', 'brief', 'verbose',
                'debug' or 'trace'

That elicits some questions:

  1. Why so many different arguments to control the same thing?
  2. What is the difference between ‘verbose’, ‘debug’ and ‘trace’?

I believe that the answer for 1 is: “Backwards compatibility”.

I believe that the answer for 2 is: “They order the options are listed is ‘crescent level of verbosity’”.

3 Likes