winstonjs/winston ? reverse-engineered prompt

Reverse engineered prompt

Build me a flexible logging library for Node.js that people can drop into pretty much any app. I want developers to be able to create their own logger, choose levels like error, warn, info, debug, and send logs to more than one place at once, especially the console and local files. It should support different output styles, including clean human readable text and JSON, let people attach default metadata like a service name, and make it easy to add, remove, or reconfigure outputs later.

Please cover the practical stuff too, like custom log levels, handling uncaught exceptions and promise rejections, basic profiling, and support for querying or streaming logs where it makes sense. Include a simple shared default logger, but make the recommended path creating your own logger. I’d also like clear examples for common setups, solid tests, and TypeScript definitions so it feels production ready. Keep the API straightforward and pleasant to use, and look up current docs online if you need to fill in any gaps.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab