logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bulbuk, Ole" <obul...@kelman.de>
Subject Bug in CyclicBuffer.resize(int)?
Date Mon, 12 Feb 2001 13:14:07 GMT
Hi to all,

I just extended log4j for my needs (my version supports more intelligent
throwables (i.e.: linked throwables, wrapper exceptions, ...) and I added a
simple priority filter for a given priority and up plus I added a buffer
appender) and it worked just great.
The buffer appender stores events in a CyclicBuffer and forwards them all
when a higher event triggers it. This way you get all the warnings, infos
and debug events only when an error occured.
The buffer appender uses the class CyclicBuffer to store the events. But in
the resize(int) method CyclicBuffer doesn't adjust "last".
I suppose there should be something like
if (loogLen == newSize) {
    last = 0;
} else {
    last = loopLen;
}
near the end of the method.
This ensures that last points behind the last event in the array.

Regards,

Ole

P.S.: If anyone is interested in the changes, just send a mail.
-- 
Ole Bulbuk             Fon://+49/30/6576/3724
Kelman GmbH            Fax://+49/30/6576/3601
Haus 40                mailto:OBulbuk@Kelman.de
Koepenicker Str. 325   http://www.Kelman.de
12555 Berlin, Germany

Mime
View raw message