stencila/logga

Remove first two lines for synthetic stack traces.

Closed this issue ยท 1 comments

Currently, logga generates a stack trace if one is not supplied:

logga/src/index.ts

Lines 50 to 56 in 36f9858

let stackTrace: string
if (typeof info === 'object' && info.stackTrace) {
stackTrace = info.stackTrace
} else {
const error = new Error()
stackTrace = error.stack
}

However, this causes an extra two lines at the start of the trace that are not useful e.g.

info: README.md Error: 
    at emitLogData (/home/nokome/stencila/source/stencila/node_modules/@stencila/logga/dist/index.js:37:21)
    at Object.info (/home/nokome/stencila/source/stencila/node_modules/@stencila/logga/dist/index.js:89:13)
    at FSWatcher.chokidar_1.default.watch.on (/home/nokome/stencila/source/stencila/src/commands/preview.ts:77:18)
    at FSWatcher.emit (events.js:182:13)
    at FSWatcher.EventEmitter.emit (domain.js:442:20)
    at emitEvent (/home/nokome/stencila/source/stencila/node_modules/chokidar/index.js:434:15)
    at FSWatcher._emit (/home/nokome/stencila/source/stencila/node_modules/chokidar/index.js:476:5)
    at fs.stat (/home/nokome/stencila/source/stencila/node_modules/chokidar/lib/nodefs-handler.js:310:22)
    at FSReqWrap.oncomplete (fs.js:153:5)

It would be nice to remove those first two lines.

๐ŸŽ‰ This issue has been resolved in version 1.1.1 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€