logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shuvalov, Andrew V" <Andrew.Shuva...@gs.com>
Subject RE: Virtual LoggingEvent
Date Fri, 28 May 2004 13:23:08 GMT

Hi Michael,

The idea is that I need to provide NDC functionality in pure C code, so the
C++ implementation in the ndc.cpp may not be used. The connection point
between custom NDC and the rest of the library is only one - getNDC() in the
Logging event. So I want it to go and execute my C code from it.

In general, the ultimate task is to have some logging facilities that can be
transparently used in C and C++, but I don't see an easy way to do that.
Most likely C code will keep its own logging, but at least I can share NDC.

Does it really break anything?

Andrew

-----Original Message-----
From: Michael CATANZARITI [mailto:mcatan@free.fr] 
Sent: Friday, May 28, 2004 7:36 AM
To: Log4CXX User
Subject: Re: Virtual LoggingEvent


Andrew,

Yes it will be done in the next version but I keep thinking overriding
LoggingEvent is not a good solution. For example, the SocketAppender will
not work with a custom LoggingEvent. Moreover, if you override is no more
compatible with the XML format of an event (see XMLLayout), the
interoperability with Log4j  Chainsaw will be broken.

May be can you, explain what is your exact requirement about NDC, and why
the implemented proposed in log4cxx does not suit ?

Michaƫl

Selon "Shuvalov, Andrew V" <Andrew.Shuvalov@gs.com>:

> 
> 
> So can we do that?
> 
> I mean, change spi/loggingevent.h to have:
> 
> 	virtual ~LoggingEvent();
> 
> and
> 
> 	virtual const String& getNDC() const;
> 
> I'll be totally happy :-)))
> Thanks!
> 
> >
> > Hi,
> >
> > I wonder if it makes sense to make the LoggingEvent class virtual. 
> > I'm
> > overriding it, and everything is ok as long as I don't need to 
> > substitute a method or another. But it looks like I'd like to have 
> > this option.
> >
> > Explicitly, I want to be able to override the getNDC() method, 
> > because
> > I want to substitute the NDC implementation from the package with my 
> > own implementation. I need this for better integration with C. I want 
> > some C libraries to use NDC and make it compatible with log4cxx.
> >
> > What do you think?
> > Andrew
> >
> 
> 


Mime
View raw message