Compare commits

...

2 Commits

Author SHA1 Message Date
6560923704
forgot to pass the child to the logger funcs 2022-11-08 22:46:08 +02:00
f4e9f2ac0f
v1.1.4 2022-11-08 22:11:49 +02:00
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@navy.gif/logger", "name": "@navy.gif/logger",
"version": "1.1.3", "version": "1.1.5",
"description": "Logging thing", "description": "Logging thing",
"main": "index.js", "main": "index.js",
"author": "Navy.gif", "author": "Navy.gif",

View File

@ -24,8 +24,8 @@ class MasterLogger {
for (const type of this.types) { for (const type of this.types) {
Object.defineProperty(this, type, { Object.defineProperty(this, type, {
// Only write debug outputs if debug mode is enabled // Only write debug outputs if debug mode is enabled
value: (msg) => msg.type === 'debug' && debug || msg.type !== 'debug' value: (msg, child) => msg.type === 'debug' && debug || msg.type !== 'debug'
? this.write(type, msg) : null ? this.write(type, msg, child) : null
}); });
} }
this.colours = { ...Defaults.Colours, ...customColors }; this.colours = { ...Defaults.Colours, ...customColors };
@ -44,7 +44,7 @@ class MasterLogger {
child.on('message', (msg) => { child.on('message', (msg) => {
if (!msg._logger) return; if (!msg._logger) return;
const { message, type } = msg; const { message, type } = msg;
this[type](message); this[type](message, child);
}); });
} }