debug-js/debug ? reverse-engineered prompt
Reverse engineered prompt
Build me a tiny JavaScript debugging helper like the popular debug package.
I want to be able to create named loggers for different parts of an app, like http or worker:a, and then turn them on or off with a DEBUG setting using names, wildcards, and exclusions. It should work in both Node and the browser, print nicely colored output when supported, and show the time difference between calls so I can see how long things take. Please make it easy to use with the usual debug('message %o', value) style formatting, and let me inspect objects cleanly.
In the browser, keep the enabled state in localStorage. In Node, follow the usual environment variable behavior. If anything is unclear, look up current docs online and match the expected behavior as closely as possible. Also include a few simple tests so I can see it works.
Are you gonna build this?
make sure you review the code using coderabbit