[Interest] Logging best practice.

Charley Bay charleyb123 at gmail.com
Fri Dec 2 15:33:10 CET 2011


On Fri, Dec 2, 2011 at 12:21 AM, Bo Thorsen <bo at fioniasoftware.dk> wrote:

> Den 02-12-2011 08:21, Bo Thorsen skrev:
> > Den 01-12-2011 22:46, Charley Bay skrev:
> >>
> >> qLog(Type) << "string=" << str << ", int=" << i;
> >>
> >> That code is not re-entrant,
> >
> > Wrong.
>

My mistake -- sorry.  Yes, a local LoggerHelper would make it re-entrant
(essential of course).

My original point was to ensure an atomic call to the ultimate logger,
which the syntax didn't suggest (because of multiple calls in the single
expression), but yes, a LoggerHelper would provide.

Apologies for my noise.

As an aside, with the "stream operator" syntax, is there any interest in
supporting "localization" for logging?  The atomic "message-format-string"
we found easier to localize:

"some value %1 exceeds the limit of %2"

--charley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20111202/7c81bc86/attachment.html>


More information about the Interest mailing list