]> source.dussan.org Git - vaadin-framework.git/commitdiff
Replace printStackTrace with getLogger().log() (#12147)
authorArtur Signell <artur@vaadin.com>
Fri, 28 Jun 2013 13:31:48 +0000 (16:31 +0300)
committerVaadin Code Review <review@vaadin.com>
Fri, 28 Jun 2013 13:34:13 +0000 (13:34 +0000)
Change-Id: I9ec61fdc7ddc06f129a9d69b99e6295a62c4b0d3

server/src/com/vaadin/server/VaadinServlet.java
server/src/com/vaadin/server/themeutils/SASSAddonImportFileCreator.java
server/src/com/vaadin/ui/components/colorpicker/ColorPickerPopup.java

index a9eb42578e9b23b6ae346a9696adf6e69c9eb27d..94601d6599bcc290c415f09cd4e1de2a6a4d7ff5 100644 (file)
@@ -814,7 +814,7 @@ public class VaadinServlet extends HttpServlet implements Constants {
                         new Object[] { realFilename, filename });
                 scss.compile();
             } catch (Exception e) {
-                e.printStackTrace();
+                getLogger().log(Level.WARNING, "Scss compilation failed", e);
                 return false;
             }
 
index f199c347eb5e8d825632d2c1e09dcfac711b2998..94ca9e7d5bcabac7f18d509623d5f89057cd3e1e 100644 (file)
@@ -26,6 +26,8 @@ import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 import com.vaadin.server.widgetsetutils.ClassPathExplorer;
 import com.vaadin.server.widgetsetutils.ClassPathExplorer.LocationInfo;
@@ -126,10 +128,14 @@ public class SASSAddonImportFileCreator {
 
         } catch (FileNotFoundException e) {
             // Should not happen since file is checked before this
-            e.printStackTrace();
+            getLogger().log(Level.WARNING, "Error updating addons.scss", e);
         }
     }
 
+    private static Logger getLogger() {
+        return Logger.getLogger(SASSAddonImportFileCreator.class.getName());
+    }
+
     private static List<String> addImport(PrintStream stream, String file,
             URL location) {
 
index b1eef16024fffaf367ea66223731cd88403b2f11..9774211beaa53ff87b267d5dabb6b44febfa6457 100644 (file)
@@ -22,6 +22,8 @@ import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 import com.vaadin.data.Property.ValueChangeEvent;
 import com.vaadin.data.Property.ValueChangeListener;
@@ -567,7 +569,10 @@ public class ColorPickerPopup extends Window implements ClickListener,
             blueSlider.setValue(((Integer) color.getBlue()).doubleValue());
             greenSlider.setValue(((Integer) color.getGreen()).doubleValue());
         } catch (ValueOutOfBoundsException e) {
-            e.printStackTrace();
+            getLogger().log(
+                    Level.WARNING,
+                    "Unable to set RGB color value to " + color.getRed() + ","
+                            + color.getGreen() + "," + color.getBlue(), e);
         }
     }
 
@@ -577,7 +582,10 @@ public class ColorPickerPopup extends Window implements ClickListener,
             saturationSlider.setValue(((Float) (hsv[1] * 100f)).doubleValue());
             valueSlider.setValue(((Float) (hsv[2] * 100f)).doubleValue());
         } catch (ValueOutOfBoundsException e) {
-            e.printStackTrace();
+            getLogger().log(
+                    Level.WARNING,
+                    "Unable to set HSV color value to " + hsv[0] + "," + hsv[1]
+                            + "," + hsv[2], e);
         }
     }
 
@@ -764,4 +772,8 @@ public class ColorPickerPopup extends Window implements ClickListener,
             return color;
         }
     };
+
+    public static Logger getLogger() {
+        return Logger.getLogger(ColorPickerPopup.class.getName());
+    }
 }
\ No newline at end of file