Yarn: No way to control output verbosity

Created on 27 Oct 2016  路  7Comments  路  Source: yarnpkg/yarn

Do you want to request a _feature_ or report a _bug_?
_feature_

What is the current behavior?
No way to increase/change cli output verbosity. No way to trace yarn's low level operations for troubleshooting purposes.

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?
yarn should have a flag/configuration to control verbosity level. Something like npm's --loglevel <level> and --verbose.
As an example, try running npm i yarn --dry-run --verbose

Please mention your node.js, yarn and operating system version.
node v6.9.1
yarn v0.16.1
Fedora 24

Most helpful comment

Basically it is very useful for troubleshooting, tracing and debugging. Have a look at npm's output for npm i yarn --dry-run --verbose:

npm info it worked if it ends with ok
npm verb cli [ '/home/elektronik/.nodenv/versions/6.9.1/bin/node',
npm verb cli   '/home/elektronik/.nodenv/versions/6.9.1/bin/npm',
npm verb cli   'i',
npm verb cli   'yarn',
npm verb cli   '--dry-run',
npm verb cli   '--verbose' ]
npm info using [email protected]
npm info using [email protected]
npm verb request uri https://registry.npmjs.org/yarn
npm verb request no auth needed
npm info attempt registry request try #1 at 9:56:52 PM
npm verb request id 3a8196a920aec54b
...
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   linux
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
npm WARN [email protected] requires a peer of mocha@^2.0.1 but none was installed.
npm verb 
npm verb If you need help, you may report this error at:
npm verb     <https://github.com/npm/npm/issues>
npm verb exit [ 0, true ]
npm info ok 

I can see the invoked commands, arguments, current environment, http requests and headers, authentication details, cache hits, semver resolution, target files on the filesystem.

Ruby Bundler and Rust Cargo both have a --verbose flag as well.

All 7 comments

We don't log any of Yarn's low level operations. I'm curious what type of information you think would be useful?

Basically it is very useful for troubleshooting, tracing and debugging. Have a look at npm's output for npm i yarn --dry-run --verbose:

npm info it worked if it ends with ok
npm verb cli [ '/home/elektronik/.nodenv/versions/6.9.1/bin/node',
npm verb cli   '/home/elektronik/.nodenv/versions/6.9.1/bin/npm',
npm verb cli   'i',
npm verb cli   'yarn',
npm verb cli   '--dry-run',
npm verb cli   '--verbose' ]
npm info using [email protected]
npm info using [email protected]
npm verb request uri https://registry.npmjs.org/yarn
npm verb request no auth needed
npm info attempt registry request try #1 at 9:56:52 PM
npm verb request id 3a8196a920aec54b
...
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   linux
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
npm WARN [email protected] requires a peer of mocha@^2.0.1 but none was installed.
npm verb 
npm verb If you need help, you may report this error at:
npm verb     <https://github.com/npm/npm/issues>
npm verb exit [ 0, true ]
npm info ok 

I can see the invoked commands, arguments, current environment, http requests and headers, authentication details, cache hits, semver resolution, target files on the filesystem.

Ruby Bundler and Rust Cargo both have a --verbose flag as well.

I'd like to have --verbose _at least_ to be able to see the actual error message without having to do grep -A-1 Trace yarn-error.log.

Basically helpful for any error where it's not immediately obvious why you encountered that error. Just as one example: when I get a message saying that git clone failed, but it's for a URI that I don't see in package.json, nor in any of the other package.jsons in my repo, it'd be nice to know why yarn was trying to install that particular URI. Which package was it trying to install/resolve? What's the path here?

I was kinda surprised there wasn't any kind of verbose/logging/debugging mode. Feels like a real bootstrapping problem for new software. How do we even know what's going wrong without the ability to see _why_ it's doing what it's doing?

duplicate to #763

Due to no verbose logging support, can someone say how I may takle issues like this:

events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: Command `yarn publish ./.build/` exited with code 1
    at ChildProcess.handleSubShellExit (D:\PNR\workspaces\Basis\ng-isy-style\node_modules\gulp-run\command.js:166:13)
    at ChildProcess.g (events.js:260:16)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)

Basically, nothing I can work with. :-1:

This is essentially the same as #763, so I'm going to close this task in favour of that one. Thanks for trying Yarn! 馃槃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidmaxwaterman picture davidmaxwaterman  路  3Comments

FLGMwt picture FLGMwt  路  3Comments

chiedo picture chiedo  路  3Comments

sebmck picture sebmck  路  3Comments

sanex3339 picture sanex3339  路  3Comments