From: Ernie Makris (ernie_makris_at_[hidden])
Date: 2002-04-09 08:45:34
>Eugene Karpachov wrote:
> > 9 Apr 2002 05:55:49 +0400 Ernie Makris wrote:
> > > It would look like the following:
> > > log << log_debug << log_format("%e %1") % "config file not found";
> > ^^^^^^^
> > Please not that ugly format string again! Streams was invented to get
> > out of this cryptic, type-unsafe and processor-time-consuming feature,
>That's exactly what the format library was designed for, isn't it?
>It's usage is typesafe and it allows for those nice and handy format
I agree, the format library is definitely a step above ordinary printf
style format strings. But, using a formatter would not be a hard and fast
rule. I think it should be allowed to just say:
logger << "foo: " << foo << "bar: " << bar << "baz: " << baz;
logger << log_format("foo: %1 bar: %2 baz: %3") % foo % bar % baz;
>I think we should not again start a discussion of printf vs. streams,
>as the whole format library can be designed using a nice stream interface
>and those who like it can use format.
>An additional log_format() could be provided as a useful addon for those
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk