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

Control logging through options.logging param #181

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vladimyr
Copy link
Contributor

@vladimyr vladimyr commented May 20, 2019

This PR introduces optional options param to deployForEnv function changing its signature to:

/**
 * Deploy to a single environment
 * @param {object} deployConfig object containing deploy configs for all environments
 * @param {string} env the name of the environment to deploy to
 * @param {array} args custom deploy command-line arguments
 * @param {object} [options={}] deploy options
 * @param {boolean|function} [options.logging=console.log] logging function or `false` to disable logging
 * @param {DeployCallback} cb done callback
 * @returns {boolean} return value is always `false`
 */
function deployForEnv(deployConfig, env, args, options, cb) { ... }

(It is an optional param, so there is no fear in breaking existing usage pattern which will simply default to console.log as expected.)
This enables control of logging behavior from outside instead of hardcoding console.log calls 🔧

vladimyr added 2 commits May 21, 2019 00:58
- implementing `options.logging` that defaults to `console.log`;
  updating tests to use `options.logging = false;`
- updating docs
- swapping map + join with single pass reduce
@UFarooqDevelop
Copy link

update

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.

2 participants