2019-07-17 13:20:13 +03:00
|
|
|
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));
|
|
|
|
}
|
|
|
|
});
|
2019-12-12 11:19:36 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
get errors() {
|
2021-06-28 19:13:37 +03:00
|
|
|
return require('@tryghost/ignition-errors');
|
2019-07-17 13:20:13 +03:00
|
|
|
}
|
|
|
|
};
|