forgot a quite important part >.>
This commit is contained in:
parent
4302fbab57
commit
310b77a4a5
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@navy.gif/logger",
|
"name": "@navy.gif/logger",
|
||||||
"version": "1.1.1",
|
"version": "1.1.2",
|
||||||
"description": "Logging thing",
|
"description": "Logging thing",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"author": "Navy.gif",
|
"author": "Navy.gif",
|
||||||
|
@ -38,6 +38,12 @@ class MasterLogger {
|
|||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
|
process.on('message', (msg) => {
|
||||||
|
if (!msg._logger) return;
|
||||||
|
const { message, type } = msg;
|
||||||
|
this[type](message);
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
write (type = 'info', text, shard = null) {
|
write (type = 'info', text, shard = null) {
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
const { MasterLogger } = require('../');
|
const { MasterLogger } = require('../');
|
||||||
|
|
||||||
const logger = new MasterLogger({ debug: true, customTypes: [ 'access' ], customStreams: [ 'access' ], customTypeMapping: { access: 'access', warn: 'error' }, customColors: { access: 'green' } });
|
const logger = new MasterLogger({
|
||||||
|
debug: true,
|
||||||
|
customTypes: [ 'access' ],
|
||||||
|
customStreams: [ 'access' ],
|
||||||
|
customTypeMapping: { access: 'access', warn: 'error' },
|
||||||
|
customColors: { access: 'green' }
|
||||||
|
});
|
||||||
const { types, colours, streamTypes, streamTypeMapping } = logger; // , writeStreams
|
const { types, colours, streamTypes, streamTypeMapping } = logger; // , writeStreams
|
||||||
|
|
||||||
console.log(types, colours, streamTypes, streamTypeMapping); // , writeStreams
|
console.log(types, colours, streamTypes, streamTypeMapping); // , writeStreams
|
||||||
|
Loading…
Reference in New Issue
Block a user