mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 18:01:36 +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));
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
};
|