MatrixAI / js-logger

TypeScript/JavaScript Logger Library
https://polykey.com
Apache License 2.0
1 stars 0 forks source link

Optimising the stack trace slicing #8

Closed CMCDragonkai closed 2 years ago

CMCDragonkai commented 2 years ago

Description

Based on ideas in js-async-init, this optimises the stack trace slicing to use indexOf rather than splitting and joining. Also the check for captureStackTrace and stackTraceLimit is now done statically.

I've also mocked out the console.error and process.stderr.write so that way we don't get weird looking messages when running tests.

Final checklist