logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: Status of stream.h?
Date Mon, 06 Jun 2005 18:57:21 GMT

On Jun 3, 2005, at 7:14 AM, Paul Butcher wrote:

> I am having problems with the code within <log4cxx/stream.h>. Using  
> it in a
> single source file works fine, but when I try to use it more than  
> once, I get
> the following when linking:
>
> In function `operator<<(log4cxx::logstream&, char const*)':
> log4cxx/stream.h:153: multiple definition of `operator<< 
> (log4cxx::logstream&,
> char const*)'
>
> Plus a lot of other similar errors.
>
> I'm using g++ (GCC) 3.3.4 (pre 3.3.5 20040809).
>
> I get the impression that this code is still evolving? Is it ready  
> for "prime
> time" yet?
>

It has been stalled for quite some time, however Christopher Smith  
has expressed interest in restarting it.  The semantics shouldn't  
change much but the current approach has a surprisingly high cost to  
instantiate a logstream object.  It is not trivial to preserve the  
STL stream semantics while deferring the startup cost until the first  
logging request that satisfies the criteria.

> A wider question: what is the preferred mechanism for generating  
> log messages
> which are more than just fixed strings?

log4j's CVS HEAD has a parameterized log methods that could mimicked  
in log4cxx, but I haven't mocked anything out.  The new log4j methods  
are something like:

logger.info("Hello, {}.", "World");


It isn't the most general approach, but it does cover a huge amount  
of common use cases.



>
> Thanks in advance!
>
> paul.butcher->msgCount++
>
> Snetterton, Castle Combe, Cadwell Park...
> Who says I have a one track mind?
>


Mime
View raw message