app.log.dump destroys original stack trace
Take this SQL error for example.
[2021-06-02 09:31:32.0187 BRYANTONG-ERROR] Database initialization failed: (conn=2275983, no: 1170, SQLState: 42000) BLOB/TEXT column 'data' used in key specification without a key length
sql: CREATE TABLE IF NOT EXISTS `Session` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`sid` VARCHAR(255) NOT NULL DEFAULT '0',
`ip` VARCHAR(255) DEFAULT NULL,
`agent` VARCHAR(255) DEFAULT NULL,
`uid` VARCHAR(255) DEFAULT NULL,
`data` LONGTEXT,
`crea...
TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of SqlError
at readableAddChunk (_stream_readable.js:243:13)
at LogEngine.Readable.push (_stream_readable.js:213:10)
at LogEngine.message (/home/node/bryantong/node_modules/kado/lib/Log.js:105:10)
at /home/node/bryantong/node_modules/kado/lib/Log.js:30:25
at Array.forEach (<anonymous>)
at Log.message (/home/node/bryantong/node_modules/kado/lib/Log.js:29:24)
at Log.dump (/home/node/bryantong/node_modules/kado/lib/Log.js:40:21)
at Command.action (/home/node/bryantong/lib/App.js:79:19)
The stack trace is the call into the logging system up to the actual print of the log. This needs to output the trace that came with the error.