@byuhbll/log-interceptor
v0.0.3
Published
Basic JavaScript library for intercepting default logger to customize/enrich log output.
Downloads
98
Keywords
Readme
Log Interceptor (a JS Library)
This is a simple library that "monkey patches" JavaScript's native console
logger, extending its functionality and allowing for local customization. This is primarily intended for use on Node/SSR applications to improve log tracking. Note: This application is only made for and guaranteed to work with NodeJS; using it for browser rendered applications may work but is not tested.
How to Use
Since this library overrides the console logger, which is global, the following line of code can be placed in any executed JavaScript, preferably at the top level as the application is starting/bootstrapping/etc. Simply import the log interceptor and call interceptLogs()
:
import LogInterceptor from "@byuhbll/log-interceptor";
LogInterceptor.interceptLogs();