Review: std.logger
via Digitalmars-d
digitalmars-d at puremagic.com
Tue Jul 15 11:26:44 PDT 2014
On Tuesday, 15 July 2014 at 17:41:09 UTC, Jeremy Powers via
Digitalmars-d wrote:
> I believe to do this with the current setup, you would need
> some standard
> 'dispatcher' logger, and have every user of logging use it.
> Then could
> configure the dispatcher as needed for your case without
> modifying all the
> code to use a different logger.
If there is a standard dispatcher with calling conventions that
all libraries use (e.g. logging.debug(), logging.info(),
logging.error() etc) then I guess I could use textual search and
replace to retrofit the standard API with my own inlined logger.
Customization of the logging API or too many variations could
make that difficult or impossible.
Virtual functions, locking etc should be avoided so that you can
do very low overhead full logging on a live server that is under
attack. Basically just writing some bytes to a set of thread
local ring-buffers with timing information, then collect and
merge them on a crash for analysis so you can get the gory
details that lead to the crash and do emergency patching asap.
More information about the Digitalmars-d
mailing list