diff -r b78e77619152 -r 7520a9246ff5 src/org/sonews/util/Stats.java --- a/src/org/sonews/util/Stats.java Sun Sep 11 15:05:04 2011 +0200 +++ b/src/org/sonews/util/Stats.java Tue Oct 18 21:10:45 2011 +0200 @@ -18,6 +18,7 @@ package org.sonews.util; import java.util.Calendar; +import java.util.logging.Level; import org.sonews.config.Config; import org.sonews.storage.Group; import org.sonews.storage.StorageBackendException; @@ -63,10 +64,14 @@ System.currentTimeMillis(), type, group.getInternalID()); } } else { - Log.get().info("Group " + groupname + " does not exist."); + StringBuilder strBuf = new StringBuilder(); + strBuf.append("Group "); + strBuf.append(groupname); + strBuf.append(" does not exist."); + Log.get().info(strBuf.toString()); } } catch (StorageBackendException ex) { - ex.printStackTrace(); + Log.get().log(Level.SEVERE, ex.getLocalizedMessage(), ex); } } @@ -86,7 +91,7 @@ try { return StorageManager.current().countGroups(); } catch (StorageBackendException ex) { - ex.printStackTrace(); + Log.get().log(Level.SEVERE, ex.getLocalizedMessage(), ex); return -1; } } @@ -95,7 +100,7 @@ try { return StorageManager.current().countArticles(); } catch (StorageBackendException ex) { - ex.printStackTrace(); + Log.get().log(Level.SEVERE, ex.getLocalizedMessage(), ex); return -1; } } @@ -117,7 +122,7 @@ try { return StorageManager.current().getEventsCount(eventType, startTimestamp, endTimestamp, group); } catch (StorageBackendException ex) { - ex.printStackTrace(); + Log.get().log(Level.SEVERE, ex.getLocalizedMessage(), ex); return -1; } } @@ -146,7 +151,7 @@ try { return StorageManager.current().getEventsPerHour(key, gid); } catch (StorageBackendException ex) { - ex.printStackTrace(); + Log.get().log(Level.SEVERE, ex.getLocalizedMessage(), ex); return -1; } }