On Tuesday 05 May 2009 02:06:10 you wrote: > Please don't do this. > Closer is for closing the streams _silently_. > (most often in the finally{} block when error have occurred > already/expected) If you want logging, you should call .close() directly.
Errors should never occur during close so we should log them, shouldn't we? I added the logging because nextgens complained that there was no proper logging - nextgens can you explain why we need it from your point of view? > commit 9645c379de05e4f884ac3c1e2ef616884232963c > Author: xor <x...@freenetproject.org> > Date: Mon May 4 20:13:04 2009 +0200 > > Fix logging. > > diff --git a/src/freenet/support/io/Closer.java > b/src/freenet/support/io/Closer.java > index 1e7a532..6899e63 100644 > --- a/src/freenet/support/io/Closer.java > +++ b/src/freenet/support/io/Closer.java > @@ -46,6 +46,7 @@ public class Closer { > try { > closable.close(); > } catch (IOException e) { > + Logger.error(Closer.class, "Error > during close().", e); > } > } > } > @@ -59,7 +60,7 @@ public class Closer { > try { > bucket.free(); > } catch(RuntimeException e) { > - Logger.error(bucket, "Error during > free()."); + Logger.error(Closer.class, > "Error > during free().", e); > } > } > } > @@ -75,6 +76,7 @@ public class Closer { > try { > zipFile.close(); > } catch (IOException e) { > + Logger.error(Closer.class, "Error > during close().", e); > } > } > }
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Devl mailing list Devl@freenetproject.org http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl