@mbass/js-debug-logger
v0.0.5
Published
A console logger for Javascript (with TypeScript type definitions) that adds useful debug information to the logs, e.g. timestamp, name of the function performing the log, full stack trace, etc...
Downloads
1
Maintainers
Readme
js-debug-logger
A console logger for Javascript (with TypeScript type definitions) that adds useful debug information to the logs, e.g. timestamp, name of the function performing the log, full stack trace, etc...
Dependencies
None
Usage
// Import the necessary types
import { logDebugInfo, LogLevel } from '@mbass/js-debug-logger';
...
...
// Call the logging function (NB: only the first argument is mandatory)
logDebugInfo('A log at debug level, with its timestamp and its stacktrace', LogLevel.Debug, true, true);
Output produced in browser console:
[09:30:54.462|DebugInfo|inside SomeClass.doSomething()]: A log at debug level, with its timestamp and its stacktrace
Trace: The current stacktrace is:
at logDebugInfo (...\lib\index.js:30:17)
at SomeClass.doSomething (...\consumer.js:18:24)