Closed lasertunguus closed 7 years ago
For better debugging we should use logging in our JS application. A good and intuitive to use seems to be winstonjs/winston.
Logging levels (currently set to debug, adjustable in utils/log.js): { error: 0, warn: 1, info: 2, verbose: 3, debug: 4, silly: 5 }
debug
utils/log.js
{ error: 0, warn: 1, info: 2, verbose: 3, debug: 4, silly: 5 }
Usage:
var t = 'test'
logger.info('%s test', t) => test test
No need to go crazy on this, just when it seems necessary or would be useful for debugging.
@lasertunguus console.log.bind(console) should be good enough. Don't overthink it.
Closing for now. Before sending to UAT, file logging should be added.
For better debugging we should use logging in our JS application. A good and intuitive to use seems to be winstonjs/winston.
Logging levels (currently set to
debug
, adjustable inutils/log.js
):{ error: 0, warn: 1, info: 2, verbose: 3, debug: 4, silly: 5 }
Usage:
var t = 'test'
logger.info('%s test', t) => test test
No need to go crazy on this, just when it seems necessary or would be useful for debugging.