Replace console output by debug functions

This commit is contained in:
D. Berge
2022-05-15 13:37:24 +02:00
parent 105fee0623
commit f5e08c68af
2 changed files with 8 additions and 5 deletions

View File

@@ -1,9 +1,11 @@
const { listen } = require('../ws/db');
const channels = require('../lib/db/channels');
const handlers = require('./handlers').init();
const { ERROR, INFO, DEBUG } = require('DOUGAL_ROOT/debug')(__filename);
function start () {
listen(channels, async function (data) {
DEBUG("Incoming data", data);
for (const handler of handlers) {
// NOTE: We are intentionally passing the same instance
// of the data to every handler. This means that earlier
@@ -15,7 +17,7 @@ function start () {
}
});
console.log("Events manager started.", handlers.length, "active handlers");
INFO("Events manager started.", handlers.length, "active handlers");
}
module.exports = { start }