Re: [xwiki-devs] [xwiki-notifications] r32285 - platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/pdf/impl
On Oct 31, 2010, at 5:48 AM, sdumitriu (SVN) wrote:
Author: sdumitriu Date: 2010-10-31 05:48:50 +0100 (Sun, 31 Oct 2010) New Revision: 32285
Modified: platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/pdf/impl/PdfExportImpl.java platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/pdf/impl/PdfURLFactory.java Log: XWIKI-5639: PDF export doesn't contain images if the document name contains non-ASCII characters Fixed.
[snip]
- for (int i = 0; i < filelist.length; i++) { - filelist[i].delete(); + try { + FileUtils.deleteDirectory(tempdir); + } catch (IOException ex) { + // Should not happen, but it's nothing serious, just that temporary files are left on the disk. + log.warn("Failed to cleanup temporary files after a PDF export", ex);
I thought our strategy was to not display stack trace unless the log was about an error? (at least this is the strategy I've always followed since a stack trace takes up a lot of space, draws the eye, etc). What I do usually is just display the nested message without the stack trace. Note: It might be good to have a utility method somewhere to extract all messages from all nested exceptions without the stack trace. WDYT? Thanks -Vincent [snip]
On 10/31/2010 08:13 AM, Vincent Massol wrote:
On Oct 31, 2010, at 5:48 AM, sdumitriu (SVN) wrote:
Author: sdumitriu Date: 2010-10-31 05:48:50 +0100 (Sun, 31 Oct 2010) New Revision: 32285
Modified: platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/pdf/impl/PdfExportImpl.java platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/pdf/impl/PdfURLFactory.java Log: XWIKI-5639: PDF export doesn't contain images if the document name contains non-ASCII characters Fixed.
[snip]
- for (int i = 0; i< filelist.length; i++) { - filelist[i].delete(); + try { + FileUtils.deleteDirectory(tempdir); + } catch (IOException ex) { + // Should not happen, but it's nothing serious, just that temporary files are left on the disk. + log.warn("Failed to cleanup temporary files after a PDF export", ex);
I thought our strategy was to not display stack trace unless the log was about an error? (at least this is the strategy I've always followed since a stack trace takes up a lot of space, draws the eye, etc). What I do usually is just display the nested message without the stack trace. Note: It might be good to have a utility method somewhere to extract all messages from all nested exceptions without the stack trace.
OK, I thought the limit was on WARN, not on ERROR. +1 for the extractAllMessages method. -- Sergiu Dumitriu http://purl.org/net/sergiu/
On Sun, Oct 31, 2010 at 12:44, Sergiu Dumitriu <[email protected]> wrote:
On 10/31/2010 08:13 AM, Vincent Massol wrote:
On Oct 31, 2010, at 5:48 AM, sdumitriu (SVN) wrote:
Author: sdumitriu Date: 2010-10-31 05:48:50 +0100 (Sun, 31 Oct 2010) New Revision: 32285
Modified: platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/pdf/impl/PdfExportImpl.java platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/pdf/impl/PdfURLFactory.java Log: XWIKI-5639: PDF export doesn't contain images if the document name contains non-ASCII characters Fixed.
[snip]
- for (int i = 0; i< filelist.length; i++) { - filelist[i].delete(); + try { + FileUtils.deleteDirectory(tempdir); + } catch (IOException ex) { + // Should not happen, but it's nothing serious, just that temporary files are left on the disk. + log.warn("Failed to cleanup temporary files after a PDF export", ex);
I thought our strategy was to not display stack trace unless the log was about an error? (at least this is the strategy I've always followed since a stack trace takes up a lot of space, draws the eye, etc). What I do usually is just display the nested message without the stack trace. Note: It might be good to have a utility method somewhere to extract all messages from all nested exceptions without the stack trace.
OK, I thought the limit was on WARN, not on ERROR.
+1 for the extractAllMessages method.
Also we are not supposed to used directly log4j but commons log instead. Should be protected static final Log LOG = LogFactory.getLog(PdfURLFactory.class); instead of private static final Logger LOG = Logger.getLogger(PdfURLFactory.class); as you can see in PdfExportImpl.java
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
participants (3)
-
Sergiu Dumitriu -
Thomas Mortagne -
Vincent Massol