mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 13:22:39 +03:00
19 lines
527 B
JavaScript
19 lines
527 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));
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
};
|