Improve multi-attempt logging

This commit is contained in:
mmorrison 2019-02-13 22:46:13 -06:00
parent ab6e9064d2
commit dd5dce21db
3 changed files with 34 additions and 42 deletions

View file

@ -3,6 +3,7 @@ const HexUtil = require('./HexUtil');
class Logger {
constructor() {
this.debugEnabled = false;
this.prefix = '';
}
debug(...args) {
@ -14,6 +15,9 @@ class Logger {
try {
const strings = this._convertArgsToStrings(...args);
if (strings.length) {
if (this.prefix) {
strings.unshift(this.prefix);
}
console.log(...strings);
}
} catch(e) {