Use debug package for logging

This commit is contained in:
Tau
2019-11-06 17:28:30 -05:00
parent db260d5f2f
commit 9697b4b06e
21 changed files with 110 additions and 60 deletions
+8 -1
View File
@@ -1,7 +1,10 @@
import logger from "debug";
import { Transform } from "stream";
import * as Request from "./request";
const debug = logger("app:aimedb:decoder");
function begin(msg: Buffer): Request.AimeRequestBase {
const gameId = msg.toString("ascii", 0x000a, 0x000e);
const keychipId = msg.toString("ascii", 0x0014, 0x001f);
@@ -116,6 +119,10 @@ export class Decoder extends Transform {
);
}
return callback(null, reader(msg));
const obj = reader(msg);
debug(`Decode ${JSON.stringify(obj)}`);
return callback(null, obj);
}
}