[Devel] Feature request: error/debug message extension.

Paul Giblock pgiblox at gmail.com
Thu Jan 12 14:09:34 PST 2012


> This would let the host do pretty much anything (by putting whatever in
> the handle), but also make a trivial implementation extremely simple
> (you could literally use pointers to printf and vprintf with a FILE*
> handle if you just want to print to stdout anyway).

Yes, although the trivial solution is inherently not real-time safe.
Good to still have the option for a host to be quick and careless
though.

> One thing this does not address, though, is multiple streams e.g. for
> errors, warnings, and info messages.

I wonder if extensibility of the different streams is necessary or
not? I'm thinking "no".  We could allow mapped URIs for the different
streams, and predefine a few (error, warn, and info)?  But, if you
study the popular Log4j or java.util.logging Java packages, it seems
people are happy enough with: Fatal, Error, Warn, Info, Debug, Trace.
I'm suggesting one more argument before the format string for the
enumerated value of the stream. (The java logging packages seem to
call these logging "levels").

Finally, I feel it is a good idea to support the format-string and
varg variants. Not only are the plugins relieved from the duty of
string-banging while in RT mode, but the host is able to short-circuit
the whole thing should the level be under some threshold.

Paul



More information about the Devel mailing list