Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infer log level from npm's own logLevel #78

Merged
merged 3 commits into from
Dec 21, 2018
Merged

Infer log level from npm's own logLevel #78

merged 3 commits into from
Dec 21, 2018

Conversation

jasonkarns
Copy link
Member

Followup to #74

In most cases, if the user want's npm to be silent, they'll presumably
want scripty to be silent as well. (And similarly for the other levels.)
if (userOptions.logLevel) return userOptions.logLevel

if (userOptions.verbose) return log.verbose

if (userOptions.dryRun) return log.info

if (userOptions.silent || userOptions.quiet) return log.silent

return npmLevel[process.env.npm_config_loglevel]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid too many return statements within this function.

@jasonkarns jasonkarns merged commit 75ae875 into master Dec 21, 2018
@jasonkarns jasonkarns deleted the npm-log-level branch December 21, 2018 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant