Also any part of the program can send data to the logger. This means the logger can receive malicious payloads from anywhere. Maybe your logger handles ascii control characters badly?
Also any part of the program can send data to the logger. This means the logger can receive malicious payloads from anywhere. Maybe your logger handles ascii control characters badly?
The only even slightly tricky part is like "don't mess unicode up", rest is straightforward. Sure it can be complicated with logging sinks, configurability, when to flush, monitoring and so on but in many cases you just don't need all that. You just build it whenever you do need it.
Capture log messages and write them directly to stderr? That’s easy.
This is where the LLM coded library replacements make sense. When you have non-critical code that can be easily swapped, I’m happy to let an LLM generate a logging package. If I have a need to send log messages out to a separate server for archival? I’d be a little more critical.
Technically you can configure it to send to other places - presumably. In practice you'd be better just redirecting stdout, tailing the file, or installing a mod?