mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
plugins: Improve logging of plugin events
This will make it easier to troubleshoot plugin and npm issues.
This commit is contained in:
parent
4253a2ea8f
commit
dcf7891316
3 changed files with 24 additions and 14 deletions
|
@ -21,13 +21,8 @@ const stderrLogger = (line) => npmLogger.error(line);
|
|||
*/
|
||||
module.exports = exports = (args, opts = {}) => {
|
||||
const cmd = ['npm', ...args];
|
||||
logger.info(`Executing command: ${cmd.join(' ')}`);
|
||||
const p = runCmd(cmd, {stdoutLogger, stderrLogger, ...opts});
|
||||
p.then(
|
||||
() => logger.info(`Successfully ran command: ${cmd.join(' ')}`),
|
||||
() => logger.error(`npm command failed: ${cmd.join(' ')}`));
|
||||
// MUST return the original Promise returned from runCmd so that the caller can access stdout.
|
||||
return p;
|
||||
return runCmd(cmd, {stdoutLogger, stderrLogger, ...opts});
|
||||
};
|
||||
|
||||
// Log the version of npm at startup.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue