Ghost/ghost/members-api/lib/common.js
Daniel Lockyer 21ec26ea08 Removed used of ghost-ignition dependency
no issue

- we're killing off `ghost-ignition` in favor of explicit packages
  containing its individual components
- this commit switches the Members repo to using the
  `@tryghost/ignition-errors` and `@tryghost/debug` dependencies,
  updates the code with relevant changes and removes the `ghost-ignition`
  dependency
2021-06-29 21:43:05 +01:00

23 lines
607 B
JavaScript

let currentLogger = {
error: global.console.error,
info: global.console.info,
warn: global.console.warn
};
module.exports = {
get logging() {
const loggerInterface = Object.create(currentLogger);
return Object.assign(loggerInterface, {
setLogger(newLogger) {
currentLogger = newLogger;
// Overwrite any existing reference to loggerInterface
Object.assign(loggerInterface, Object.create(newLogger));
}
});
},
get errors() {
return require('@tryghost/ignition-errors');
}
};