kubernetes/klog ? reverse-engineered prompt

Reverse engineered prompt

Build me a Go logging library that works like a modern fork of glog, with leveled logs, verbosity flags, and the usual Info, Warning, Error, Fatal style calls.

I want it to feel easy to drop into an existing Go project, so the old glog import can be replaced with this one, and global flags should be initialized explicitly instead of happening behind the scenes. It should support logging to stderr or a single file, let me redirect output to my own writer, and make it easy to control logs by level and by file. Please include examples for common setups, like using it in an app, sending output somewhere else, and using it alongside older logging code if needed.

Also make sure it has good tests, because a big reason for this fork is being able to test log output cleanly. If current Go docs or logging conventions have changed, check the latest docs online and align with those.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab