Using glog's design for Phobos?
sean at invisibleduck.org
Thu Aug 26 20:11:09 PDT 2010
Walter Bright Wrote:
> Shields up! what am I missing about this?
For server work, it's important that the amount of logging be dynamically configurable and that log lines which aren't printed consume as little overhead as possible. For some of the more advanced stuff in glog, there are times when I want to turn the log level way up to try and diagnose something occurring in production, but the amount of output this generates is such that if I can have some of the irrelevant stuff left out then so much the better. Trend analysis doesn't need to log every occurrence, thus the counter stuff, etc.
One thing I did years ago for C++ was to create an ostream wrapper for the Windows Event Log. I still used std::log and std::err in my app, but a few lines of code redirecting output in main() and I could make log lines appear in the event log as messages instead. It would have been difficult to do this with printf, but a logging mechanism is generally not too difficult to configure this way.
More information about the Digitalmars-d