Unitech / pm2-deploy

Deploy part of PM2
http://pm2.keymetrics.io/docs/usage/deployment/
MIT License
178 stars 71 forks source link

Control logging through `options.logging` param #181

Open vladimyr opened 5 years ago

vladimyr commented 5 years ago

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 🔧

UFarooqDevelop commented 1 year ago

update