Skip to content

Commit

Permalink
feat: Add logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
amanda-mitchell committed Nov 12, 2020
1 parent e5a953d commit ec4d907
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ function getChildPlugin(registryName) {
return plugin;
}

function log({ stdout }, message) {
return new Promise(resolve => stdout.write(message + '\n', resolve));
}

function createCallbackWrapper(callbackName) {
return async ({ registries, ...pluginConfig }, context) => {
for (const [registryName, childConfig] of Object.entries(
Expand All @@ -29,6 +33,11 @@ function createCallbackWrapper(callbackName) {
return;
}

await log(
context,
`Performing ${callbackName} for registry ${registryName}`
);

const environmentVariablePrefix = `${registryName.toUpperCase()}_`;
const { env } = context;
const childEnv = { ...env };
Expand Down

0 comments on commit ec4d907

Please sign in to comment.