On Tuesday, 15 October 2013 at 15:53:34 UTC, Robert Schadek wrote:
That been said, you can add it. The method Logger.logf is a
variadic
template. You can simple create your own Logger Class and
overwrite that
method and implemented your structured logging approach there.
The only
pitfall is that you need a ref of type
WhateverYourLoggerClassIsCalled
and call logf on that or you fall back to the default logf
implementation provided by the Logger class. Another way would
be to
parse the message passed to logMessage and go from there.
Long story short. Global default Logger means structured logging
requires parsing. All other logger require correct reference
type of logger.
I don't think it is a good design to conflate logging mode with
output mode in a single logger class. I'd prefer to see log() as
variadic structured logger and logf() as it is now (making
conditional logger `logIf()`)