1.1 --- a/src/org/sonews/util/Stats.java Sun Sep 11 15:05:04 2011 +0200
1.2 +++ b/src/org/sonews/util/Stats.java Fri Oct 14 00:45:06 2011 +0200
1.3 @@ -18,6 +18,7 @@
1.4 package org.sonews.util;
1.5
1.6 import java.util.Calendar;
1.7 +import java.util.logging.Level;
1.8 import org.sonews.config.Config;
1.9 import org.sonews.storage.Group;
1.10 import org.sonews.storage.StorageBackendException;
1.11 @@ -63,10 +64,14 @@
1.12 System.currentTimeMillis(), type, group.getInternalID());
1.13 }
1.14 } else {
1.15 - Log.get().info("Group " + groupname + " does not exist.");
1.16 + StringBuilder strBuf = new StringBuilder();
1.17 + strBuf.append("Group ");
1.18 + strBuf.append(groupname);
1.19 + strBuf.append(" does not exist.");
1.20 + Log.get().info(strBuf.toString());
1.21 }
1.22 } catch (StorageBackendException ex) {
1.23 - ex.printStackTrace();
1.24 + Log.get().log(Level.SEVERE, ex.getLocalizedMessage(), ex);
1.25 }
1.26 }
1.27
1.28 @@ -86,7 +91,7 @@
1.29 try {
1.30 return StorageManager.current().countGroups();
1.31 } catch (StorageBackendException ex) {
1.32 - ex.printStackTrace();
1.33 + Log.get().log(Level.SEVERE, ex.getLocalizedMessage(), ex);
1.34 return -1;
1.35 }
1.36 }
1.37 @@ -95,7 +100,7 @@
1.38 try {
1.39 return StorageManager.current().countArticles();
1.40 } catch (StorageBackendException ex) {
1.41 - ex.printStackTrace();
1.42 + Log.get().log(Level.SEVERE, ex.getLocalizedMessage(), ex);
1.43 return -1;
1.44 }
1.45 }
1.46 @@ -117,7 +122,7 @@
1.47 try {
1.48 return StorageManager.current().getEventsCount(eventType, startTimestamp, endTimestamp, group);
1.49 } catch (StorageBackendException ex) {
1.50 - ex.printStackTrace();
1.51 + Log.get().log(Level.SEVERE, ex.getLocalizedMessage(), ex);
1.52 return -1;
1.53 }
1.54 }
1.55 @@ -146,7 +151,7 @@
1.56 try {
1.57 return StorageManager.current().getEventsPerHour(key, gid);
1.58 } catch (StorageBackendException ex) {
1.59 - ex.printStackTrace();
1.60 + Log.get().log(Level.SEVERE, ex.getLocalizedMessage(), ex);
1.61 return -1;
1.62 }
1.63 }