cnabio / duffle

CNAB installer
https://duffle.sh
MIT License
376 stars 54 forks source link

Global flag --verbose does not seem to do anything #685

Open hholst80 opened 5 years ago

hholst80 commented 5 years ago
holst@puff ~/src/duffle (master)
$ duffle --verbose build ./examples/helloworld/
Step 1/6 : FROM alpine:latest
 ---> caf27325b298
Step 2/6 : RUN apk update
 ---> Using cache
 ---> 79577ffd2b60
Step 3/6 : RUN apk add -u bash
 ---> Using cache
 ---> 723af152edcf
Step 4/6 : COPY Dockerfile /cnab/Dockerfile
 ---> Using cache
 ---> fa9e5d17f939
Step 5/6 : COPY app /cnab/app
 ---> Using cache
 ---> 3614143214fd
Step 6/6 : CMD ["/cnab/app/run"]
 ---> Using cache
 ---> 63080596778a
Successfully built 63080596778a
Successfully tagged deislabs/helloworld-cnab:7e937cda8de129e7b09f0b4aaa19317cc694ee2b
==> Successfully built bundle helloworld:0.1.0

holst@puff ~/src/duffle (master)
$ duffle build ./examples/helloworld/
Step 1/6 : FROM alpine:latest
 ---> caf27325b298
Step 2/6 : RUN apk update
 ---> Using cache
 ---> 79577ffd2b60
Step 3/6 : RUN apk add -u bash
 ---> Using cache
 ---> 723af152edcf
Step 4/6 : COPY Dockerfile /cnab/Dockerfile
 ---> Using cache
 ---> fa9e5d17f939
Step 5/6 : COPY app /cnab/app
 ---> Using cache
 ---> 3614143214fd
Step 6/6 : CMD ["/cnab/app/run"]
 ---> Using cache
 ---> 63080596778a
Successfully built 63080596778a
Successfully tagged deislabs/helloworld-cnab:7e937cda8de129e7b09f0b4aaa19317cc694ee2b
==> Successfully built bundle helloworld:0.1.0

holst@puff ~/src/duffle (master)
$
holst@puff ~/src/duffle (master)
$ duffle credentials generate helloworld-creds helloworld:0.1.0

holst@puff ~/src/duffle (master)
$ duffle --verbose credentials generate helloworld-creds helloworld:0.1.0

holst@puff ~/src/duffle (master)
$ 
simongdavies commented 5 years ago

VERBOSE environment variable enables verbose output, -v should be implemented or removed from the help doc

astrieanna commented 4 years ago

It appears that the value of -v is used to set the logrus log level to debug.

There are three places in the code that use logrus to print output that would only show up with -v.

  1. GetVersions when it finds a non-semver version number
  2. findCredentialSets to log the directory it is searching in
  3. addCredentialSet when it succeeds

This seems like very little logging to me, even when turning it on works. I often, when creating a bundle that is not always correct, have to add additional printfs to duffle in order to work out what has gone wrong (usually, but not always, this is mistakes in my bundle.json).

I realize that so far this issue is trending towards "it seems to do nothing because the argument is broken", but I feel like it would still usually seem to do nothing because there is nearly no logging that is even looking for whether verbose is set.