Index: /trunk/src/org/openstreetmap/josm/Main.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/Main.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/Main.java	(revision 6248)
@@ -41,4 +41,5 @@
 import javax.swing.KeyStroke;
 import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
 
 import org.openstreetmap.gui.jmapviewer.FeatureAdapter;
@@ -199,60 +200,107 @@
 
     /**
-     * Logging level (3 = debug, 2 = info, 1 = warn, 0 = none).
-     */
-    static public int log_level = 2;
-    /**
-     * Print a warning message if logging is on.
+     * Logging level (4 = debug, 3 = info, 2 = warn, 1 = error, 0 = none).
+     * @since 6248
+     */
+    public static int logLevel = 3;
+    
+    /**
+     * Prints an error message if logging is on.
      * @param msg The message to print.
-     */
-    static public void warn(String msg) {
-        if (log_level < 1)
+     * @since 6248
+     */
+    public static void error(String msg) {
+        if (logLevel < 1)
+            return;
+        System.err.println(tr("ERROR: {0}", msg));
+    }
+    
+    /**
+     * Prints a warning message if logging is on.
+     * @param msg The message to print.
+     */
+    public static void warn(String msg) {
+        if (logLevel < 2)
             return;
         System.err.println(tr("WARNING: {0}", msg));
     }
-    /**
-     * Print an informational message if logging is on.
+    
+    /**
+     * Prints an informational message if logging is on.
      * @param msg The message to print.
      */
-    static public void info(String msg) {
-        if (log_level < 2)
+    public static void info(String msg) {
+        if (logLevel < 3)
             return;
-        System.err.println(tr("INFO: {0}", msg));
-    }
-    /**
-     * Print an debug message if logging is on.
+        System.out.println(tr("INFO: {0}", msg));
+    }
+    
+    /**
+     * Prints a debug message if logging is on.
      * @param msg The message to print.
      */
-    static public void debug(String msg) {
-        if (log_level < 3)
+    public static void debug(String msg) {
+        if (logLevel < 4)
             return;
-        System.err.println(tr("DEBUG: {0}", msg));
-    }
-    /**
-     * Print a formated warning message if logging is on. Calls {@link MessageFormat#format}
+        System.out.println(tr("DEBUG: {0}", msg));
+    }
+    
+    /**
+     * Prints a formated error message if logging is on. Calls {@link MessageFormat#format}
      * function to format text.
      * @param msg The formated message to print.
      * @param objects The objects to insert into format string.
-     */
-    static public void warn(String msg, Object... objects) {
-        warn(MessageFormat.format(msg, objects));
-    }
-    /**
-     * Print a formated informational message if logging is on. Calls {@link MessageFormat#format}
+     * @since 6248
+     */
+    public static void error(String msg, Object... objects) {
+        error(MessageFormat.format(msg, objects));
+    }
+    
+    /**
+     * Prints a formated warning message if logging is on. Calls {@link MessageFormat#format}
      * function to format text.
      * @param msg The formated message to print.
      * @param objects The objects to insert into format string.
      */
-    static public void info(String msg, Object... objects) {
-        info(MessageFormat.format(msg, objects));
-    }
-    /**
-     * Print a formated debug message if logging is on. Calls {@link MessageFormat#format}
+    public static void warn(String msg, Object... objects) {
+        warn(MessageFormat.format(msg, objects));
+    }
+    
+    /**
+     * Prints a formated informational message if logging is on. Calls {@link MessageFormat#format}
      * function to format text.
      * @param msg The formated message to print.
      * @param objects The objects to insert into format string.
      */
-    static public void debug(String msg, Object... objects) {
+    public static void info(String msg, Object... objects) {
+        info(MessageFormat.format(msg, objects));
+    }
+    
+    /**
+     * Prints a formated debug message if logging is on. Calls {@link MessageFormat#format}
+     * function to format text.
+     * @param msg The formated message to print.
+     * @param objects The objects to insert into format string.
+     */
+    public static void debug(String msg, Object... objects) {
         debug(MessageFormat.format(msg, objects));
+    }
+    
+    /**
+     * Prints an error message for the given Throwable.
+     * @param t The throwable object causing the error
+     * @since 6248
+     */
+    public static void error(Throwable t) {
+        error(t.getClass().getName()+": "+t.getMessage());
+    }
+    
+    /**
+     * Prints a warning message for the given Throwable.
+     * @param t The throwable object causing the error
+     * @since 6248
+     */
+    public static void warn(Throwable t) {
+        warn(t.getClass().getName()+": "+t.getMessage());
     }
 
@@ -531,5 +579,5 @@
         Object existing = inputMap.get(keyStroke);
         if (existing != null && !existing.equals(action)) {
-            System.out.println(String.format("Keystroke %s is already assigned to %s, will be overridden by %s", keyStroke, existing, action));
+            info(String.format("Keystroke %s is already assigned to %s, will be overridden by %s", keyStroke, existing, action));
         }
         inputMap.put(keyStroke, action);
@@ -600,10 +648,10 @@
                 UIManager.setLookAndFeel(laf);
             }
-            catch (final java.lang.ClassNotFoundException e) {
-                System.out.println("Look and Feel not found: " + laf);
+            catch (final ClassNotFoundException e) {
+                info("Look and Feel not found: " + laf);
                 Main.pref.put("laf", defaultlaf);
             }
-            catch (final javax.swing.UnsupportedLookAndFeelException e) {
-                System.out.println("Look and Feel not supported: " + laf);
+            catch (final UnsupportedLookAndFeelException e) {
+                info("Look and Feel not supported: " + laf);
                 Main.pref.put("laf", defaultlaf);
             }
@@ -853,5 +901,5 @@
         String os = System.getProperty("os.name");
         if (os == null) {
-            System.err.println("Your operating system has no name, so I'm guessing its some kind of *nix.");
+            warn("Your operating system has no name, so I'm guessing its some kind of *nix.");
             platform = new PlatformHookUnixoid();
         } else if (os.toLowerCase().startsWith("windows")) {
@@ -864,5 +912,5 @@
             platform = new PlatformHookOsx();
         } else {
-            System.err.println("I don't know your operating system '"+os+"', so I'm guessing its some kind of *nix.");
+            warn("I don't know your operating system '"+os+"', so I'm guessing its some kind of *nix.");
             platform = new PlatformHookUnixoid();
         }
@@ -948,5 +996,5 @@
             }
         }
-        System.err.println("Error: Could not recognize Java Version: "+version);
+        error("Could not recognize Java Version: "+version);
     }
 
Index: /trunk/src/org/openstreetmap/josm/actions/AbstractInfoAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/AbstractInfoAction.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/actions/AbstractInfoAction.java	(revision 6248)
@@ -43,5 +43,5 @@
         String ret =  pattern.matcher(baseUrl).replaceAll("/browse");
         if (ret.equals(baseUrl)) {
-            System.out.println(tr("WARNING: unexpected format of API base URL. Redirection to info or history page for OSM object will probably fail. API base URL is: ''{0}''",baseUrl));
+            Main.warn(tr("Unexpected format of API base URL. Redirection to info or history page for OSM object will probably fail. API base URL is: ''{0}''",baseUrl));
         }
         if (ret.startsWith("http://api.openstreetmap.org/")) {
@@ -62,5 +62,5 @@
         String ret =  pattern.matcher(baseUrl).replaceAll("/user");
         if (ret.equals(baseUrl)) {
-            System.out.println(tr("WARNING: unexpected format of API base URL. Redirection to user page for OSM user will probably fail. API base URL is: ''{0}''",baseUrl));
+            Main.warn(tr("Unexpected format of API base URL. Redirection to user page for OSM user will probably fail. API base URL is: ''{0}''",baseUrl));
         }
         if (ret.startsWith("http://api.openstreetmap.org/")) {
Index: /trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java	(revision 6248)
@@ -9,4 +9,5 @@
 import java.io.IOException;
 import java.net.MalformedURLException;
+
 import javax.swing.Action;
 import javax.swing.ImageIcon;
@@ -15,4 +16,5 @@
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
+
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
@@ -21,6 +23,6 @@
 import org.openstreetmap.josm.gui.actionsupport.AlignImageryPanel;
 import org.openstreetmap.josm.gui.layer.ImageryLayer;
+import org.openstreetmap.josm.gui.preferences.imagery.WMSLayerTree;
 import org.openstreetmap.josm.io.imagery.WMSImagery;
-import org.openstreetmap.josm.gui.preferences.imagery.WMSLayerTree;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -78,5 +80,4 @@
             wms.attemptGetCapabilities(info.getUrl());
 
-            System.out.println(wms.getLayers());
             final WMSLayerTree tree = new WMSLayerTree();
             tree.updateTree(wms);
@@ -108,6 +109,5 @@
             JOptionPane.showMessageDialog(Main.parent, tr("Could not parse WMS layer list."),
                     tr("WMS Error"), JOptionPane.ERROR_MESSAGE);
-            System.err.println("Could not parse WMS layer list. Incoming data:");
-            System.err.println(ex.getIncomingData());
+            Main.error("Could not parse WMS layer list. Incoming data:\n"+ex.getIncomingData());
         }
         return null;
Index: /trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java	(revision 6248)
@@ -303,5 +303,5 @@
                         Utils.close(reader);
                     } catch (Exception e) {
-                        System.err.println(e.getMessage());
+                        Main.error(e);
                     }
                 }
Index: /trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java	(revision 6248)
@@ -33,5 +33,12 @@
 import org.openstreetmap.josm.tools.Shortcut;
 
+/**
+ * Delete unnecessary nodes from a way
+ */
 public class SimplifyWayAction extends JosmAction {
+    
+    /**
+     * Constructs a new {@code SimplifyWayAction}.
+     */
     public SimplifyWayAction() {
         super(tr("Simplify Way"), "simplify", tr("Delete unnecessary nodes from a way."), Shortcut.registerShortcut("tools:simplify", tr("Tool: {0}", tr("Simplify Way")),
@@ -41,5 +48,4 @@
 
     protected boolean confirmWayWithNodesOutsideBoundingBox(List<? extends OsmPrimitive> primitives) {
-        System.out.println(primitives);
         return DeleteCommand.checkAndConfirmOutlyingDelete(Main.map.mapView.getEditLayer(), primitives, null);
     }
Index: /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeTask.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeTask.java	(revision 6248)
@@ -1,4 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.actions.downloadtasks;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
 
 import java.util.Date;
@@ -8,6 +10,4 @@
 import java.util.Map;
 import java.util.concurrent.Future;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
 
 import org.openstreetmap.josm.Main;
@@ -184,5 +184,5 @@
                             data.setVisible(hp.isVisible());
                         } catch (IllegalStateException e) {
-                            System.err.println("Cannot change visibility for "+p+": "+e.getMessage());
+                            Main.error("Cannot change visibility for "+p+": "+e.getMessage());
                         }
                         data.setTimestamp(hp.getTimestamp());
@@ -196,5 +196,5 @@
                             it.remove();
                         } catch (AssertionError e) {
-                            System.err.println("Cannot load "+p + ": " + e.getMessage());
+                            Main.error("Cannot load "+p + ": " + e.getMessage());
                         }
                     }
Index: /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java	(revision 6248)
@@ -206,5 +206,5 @@
             } catch(Exception e) {
                 if (isCanceled()) {
-                    System.out.println(tr("Ignoring exception because download has been canceled. Exception was: {0}", e.toString()));
+                    Main.info(tr("Ignoring exception because download has been canceled. Exception was: {0}", e.toString()));
                     return;
                 }
Index: /trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java	(revision 6248)
@@ -116,5 +116,5 @@
             Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);
         } catch (SecurityException ex) {
-            System.out.println(ex);
+            Main.warn(ex);
         }
     }
@@ -127,5 +127,5 @@
             Toolkit.getDefaultToolkit().removeAWTEventListener(this);
         } catch (SecurityException ex) {
-            System.out.println(ex);
+            Main.warn(ex);
         }
         removeHighlighting();
Index: /trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 6248)
@@ -1365,5 +1365,5 @@
                     snapAngles[i] = 360-Double.parseDouble(s); i++;
                 } catch (NumberFormatException e) {
-                    System.err.println("Warning: incorrect number in draw.anglesnap.angles preferences: "+s);
+                    Main.warn("Incorrect number in draw.anglesnap.angles preferences: "+s);
                     snapAngles[i]=0;i++;
                     snapAngles[i]=0;i++;
Index: /trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 6248)
@@ -683,5 +683,5 @@
                     break;
                 } else {
-                    System.out.println("Unknown char in SearchSettings: " + s);
+                    Main.warn("Unknown char in SearchSettings: " + s);
                     break;
                 }
Index: /trunk/src/org/openstreetmap/josm/actions/upload/ApiPreconditionCheckerHook.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/upload/ApiPreconditionCheckerHook.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/actions/upload/ApiPreconditionCheckerHook.java	(revision 6248)
@@ -53,10 +53,9 @@
             for (String key: osmPrimitive.keySet()) {
                 String value = osmPrimitive.get(key);
-                if(key.length() > 255) {
+                if (key.length() > 255) {
                     if (osmPrimitive.isDeleted()) {
-                        // if OsmPrimitive is going to be deleted we automatically shorten the
-                        // value
-                        System.out.println(
-                                tr("Warning: automatically truncating value of tag ''{0}'' on deleted object {1}",
+                        // if OsmPrimitive is going to be deleted we automatically shorten the value
+                        Main.warn(
+                                tr("Automatically truncating value of tag ''{0}'' on deleted object {1}",
                                         key,
                                         Long.toString(osmPrimitive.getId())
Index: /trunk/src/org/openstreetmap/josm/command/ConflictAddCommand.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/command/ConflictAddCommand.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/command/ConflictAddCommand.java	(revision 6248)
@@ -49,5 +49,5 @@
     @Override public void undoCommand() {
         if (! Main.map.mapView.hasLayer(getLayer())) {
-            System.out.println(tr("Warning: Layer ''{0}'' does not exist any more. Cannot remove conflict for object ''{1}''.",
+            Main.warn(tr("Layer ''{0}'' does not exist any more. Cannot remove conflict for object ''{1}''.",
                     getLayer().getName(),
                     conflict.getMy().getDisplayName(DefaultNameFormatter.getInstance())
Index: /trunk/src/org/openstreetmap/josm/command/ConflictResolveCommand.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/command/ConflictResolveCommand.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/command/ConflictResolveCommand.java	(revision 6248)
@@ -61,5 +61,5 @@
 
         if (! Main.map.mapView.hasLayer(getLayer())) {
-            System.out.println(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more",
+            Main.warn(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more",
                     this.toString(),
                     getLayer().toString()
Index: /trunk/src/org/openstreetmap/josm/command/RelationMemberConflictResolverCommand.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/command/RelationMemberConflictResolverCommand.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/command/RelationMemberConflictResolverCommand.java	(revision 6248)
@@ -81,5 +81,5 @@
     public void undoCommand() {
         if (! Main.map.mapView.hasLayer(layer)) {
-            System.out.println(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more",
+            Main.warn(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more",
                     this.toString(),
                     layer.toString()
Index: /trunk/src/org/openstreetmap/josm/command/WayNodesConflictResolverCommand.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/command/WayNodesConflictResolverCommand.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/command/WayNodesConflictResolverCommand.java	(revision 6248)
@@ -9,4 +9,5 @@
 import javax.swing.Icon;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.conflict.Conflict;
 import org.openstreetmap.josm.data.osm.Node;
@@ -54,10 +55,9 @@
         super.executeCommand();
 
-        // replace the list of nodes of 'my' way by the list of merged
-        // nodes
+        // replace the list of nodes of 'my' way by the list of merged nodes
         //
         for (Node n:mergedNodeList) {
             if (! getLayer().data.getNodes().contains(n)) {
-                System.out.println(tr("Main dataset does not include node {0}", n.toString()));
+                Main.warn(tr("Main dataset does not include node {0}", n.toString()));
             }
         }
Index: /trunk/src/org/openstreetmap/josm/data/AutosaveTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/AutosaveTask.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/data/AutosaveTask.java	(revision 6248)
@@ -89,9 +89,9 @@
 
             if (!autosaveDir.exists() && !autosaveDir.mkdirs()) {
-                System.out.println(tr("Unable to create directory {0}, autosave will be disabled", autosaveDir.getAbsolutePath()));
+                Main.warn(tr("Unable to create directory {0}, autosave will be disabled", autosaveDir.getAbsolutePath()));
                 return;
             }
             if (!deletedLayersDir.exists() && !deletedLayersDir.mkdirs()) {
-                System.out.println(tr("Unable to create directory {0}, autosave will be disabled", deletedLayersDir.getAbsolutePath()));
+                Main.warn(tr("Unable to create directory {0}, autosave will be disabled", deletedLayersDir.getAbsolutePath()));
                 return;
             }
@@ -159,14 +159,14 @@
                         Utils.close(ps);
                     } catch (Throwable t) {
-                        System.err.println(t.getMessage());
+                        Main.error(t);
                     }
                     return result;
                 } else {
-                    System.out.println(tr("Unable to create file {0}, other filename will be used", result.getAbsolutePath()));
+                    Main.warn(tr("Unable to create file {0}, other filename will be used", result.getAbsolutePath()));
                     if (index > PROP_INDEX_LIMIT.get())
                         throw new IOException("index limit exceeded");
                 }
             } catch (IOException e) {
-                System.err.println(tr("IOError while creating file, autosave will be skipped: {0}", e.getMessage()));
+                Main.error(tr("IOError while creating file, autosave will be skipped: {0}", e.getMessage()));
                 return null;
             }
@@ -190,5 +190,5 @@
             File oldFile = info.backupFiles.remove();
             if (!oldFile.delete()) {
-                System.out.println(tr("Unable to delete old backup file {0}", oldFile.getAbsolutePath()));
+                Main.warn(tr("Unable to delete old backup file {0}", oldFile.getAbsolutePath()));
             } else {
                 getPidFile(oldFile).delete();
@@ -207,5 +207,6 @@
             } catch (Throwable t) {
                 // Don't let exception stop time thread
-                System.err.println("Autosave failed: ");
+                Main.error("Autosave failed:");
+                Main.error(t);
                 t.printStackTrace();
             }
@@ -257,5 +258,5 @@
                             }
                         } catch (IOException e) {
-                            System.err.println(tr("Error while creating backup of removed layer: {0}", e.getMessage()));
+                            Main.error(tr("Error while creating backup of removed layer: {0}", e.getMessage()));
                         }
 
@@ -300,10 +301,10 @@
                             }
                         } catch (Throwable t) {
-                            System.err.println(t.getClass()+":"+t.getMessage());
+                            Main.error(t);
                         } finally {
                             Utils.close(reader);
                         }
                     } catch (Throwable t) {
-                        System.err.println(t.getClass()+":"+t.getMessage());
+                        Main.error(t);
                     }
                 }
@@ -359,5 +360,5 @@
             deletedLayers.remove(backupFile);
             if (!backupFile.delete()) {
-                System.err.println(String.format("Warning: Could not delete old backup file %s", backupFile));
+                Main.warn(String.format("Could not delete old backup file %s", backupFile));
             }
         }
@@ -366,8 +367,8 @@
             pidFile.delete();
         } else {
-            System.err.println(String.format("Warning: Could not move autosaved file %s to %s folder", f.getName(), deletedLayersDir.getName()));
+            Main.warn(String.format("Could not move autosaved file %s to %s folder", f.getName(), deletedLayersDir.getName()));
             // we cannot move to deleted folder, so just try to delete it directly
             if (!f.delete()) {
-                System.err.println(String.format("Warning: Could not delete backup file %s", f));
+                Main.warn(String.format("Could not delete backup file %s", f));
             } else {
                 pidFile.delete();
@@ -380,5 +381,5 @@
             }
             if (!next.delete()) {
-                System.err.println(String.format("Warning: Could not delete archived backup file %s", next));
+                Main.warn(String.format("Could not delete archived backup file %s", next));
             }
         }
Index: /trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java	(revision 6248)
@@ -236,5 +236,5 @@
             root = document.getDocumentElement();
         } catch (Exception ex) {
-            System.out.println("Error getting preferences to save:" +ex.getMessage());
+            Main.warn("Error getting preferences to save:" +ex.getMessage());
         }
         if (root==null) return;
@@ -265,5 +265,5 @@
             ts.transform(new DOMSource(exportDocument), new StreamResult(f.toURI().getPath()));
         } catch (Exception ex) {
-            System.out.println("Error saving preferences part: " +ex.getMessage());
+            Main.warn("Error saving preferences part: " +ex.getMessage());
             ex.printStackTrace();
         }
@@ -345,5 +345,4 @@
                         List<PluginInformation> toDeletePlugins = new ArrayList<PluginInformation>();
                         for (PluginInformation pi: availablePlugins) {
-                            //System.out.print(pi.name+";");
                             String name = pi.name.toLowerCase();
                             if (installList.contains(name)) toInstallPlugins.add(pi);
@@ -355,18 +354,19 @@
                             Main.worker.submit(pluginDownloadTask);
                         }
-                            Collection<String> pls = new ArrayList<String>(Main.pref.getCollection("plugins"));
-                            for (PluginInformation pi: toInstallPlugins) {
-                                if (!pls.contains(pi.name)) pls.add(pi.name);
+                        Collection<String> pls = new ArrayList<String>(Main.pref.getCollection("plugins"));
+                        for (PluginInformation pi: toInstallPlugins) {
+                            if (!pls.contains(pi.name)) {
+                                pls.add(pi.name);
                             }
-                            for (PluginInformation pi: toRemovePlugins) {
-                                pls.remove(pi.name);
-                            }
-                            for (PluginInformation pi: toDeletePlugins) {
-                                pls.remove(pi.name);
-                                new File(Main.pref.getPluginsDirectory(),pi.name+".jar").deleteOnExit();
-                            }
-                            System.out.println(pls);
-                            Main.pref.putCollection("plugins",pls);
                         }
+                        for (PluginInformation pi: toRemovePlugins) {
+                            pls.remove(pi.name);
+                        }
+                        for (PluginInformation pi: toDeletePlugins) {
+                            pls.remove(pi.name);
+                            new File(Main.pref.getPluginsDirectory(), pi.name+".jar").deleteOnExit();
+                        }
+                        Main.pref.putCollection("plugins",pls);
+                    }
                 });
             }
@@ -949,6 +949,4 @@
     }
 
-
-
     private static void defaultUnknownWarning(String key) {
         log("Warning: Unknown default value of %s , skipped\n", key);
@@ -961,8 +959,8 @@
 
     private static void showPrefs(Preferences tmpPref) {
-        System.out.println("properties: " + tmpPref.properties);
-        System.out.println("collections: " + tmpPref.collectionProperties);
-        System.out.println("arrays: " + tmpPref.arrayProperties);
-        System.out.println("maps: " + tmpPref.listOfStructsProperties);
+        Main.info("properties: " + tmpPref.properties);
+        Main.info("collections: " + tmpPref.collectionProperties);
+        Main.info("arrays: " + tmpPref.arrayProperties);
+        Main.info("maps: " + tmpPref.listOfStructsProperties);
     }
 
@@ -973,6 +971,5 @@
     }
 
-
-     /**
+    /**
      * Convert JavaScript preferences object to preferences data structures
      * @param engine - JS engine to put object
@@ -1059,7 +1056,5 @@
             tmpPref.listOfStructsProperties.put(e.getKey(), e.getValue());
         }
-
-    }
-
+    }
 
     /**
@@ -1153,12 +1148,6 @@
             "}\n";
 
-        //System.out.println("map1: "+stringMap );
-        //System.out.println("lists1: "+listMap );
-        //System.out.println("listlist1: "+listlistMap );
-        //System.out.println("listmap1: "+listmapMap );
-
         // Execute conversion script
         engine.eval(init);
-
     }
     }
Index: /trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 6248)
@@ -373,5 +373,5 @@
         }
         if (!cacheDirFile.exists() && !cacheDirFile.mkdirs()) {
-            System.err.println(tr("Warning: Failed to create missing cache directory: {0}", cacheDirFile.getAbsoluteFile()));
+            Main.warn(tr("Failed to create missing cache directory: {0}", cacheDirFile.getAbsoluteFile()));
             JOptionPane.showMessageDialog(
                     Main.parent,
@@ -499,5 +499,5 @@
             defaults.put(key, def);
         } else if(def != null && !defaults.get(key).equals(def)) {
-            System.out.println("Defaults for " + key + " differ: " + def + " != " + defaults.get(key));
+            Main.info("Defaults for " + key + " differ: " + def + " != " + defaults.get(key));
         }
     }
@@ -556,6 +556,6 @@
                 try {
                     save();
-                } catch(IOException e){
-                    System.out.println(tr("Warning: failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile()));
+                } catch (IOException e) {
+                    Main.warn(tr("Failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile()));
                 }
                 changed = true;
@@ -652,5 +652,5 @@
         if (prefDir.exists()) {
             if(!prefDir.isDirectory()) {
-                System.err.println(tr("Warning: Failed to initialize preferences. Preference directory ''{0}'' is not a directory.", prefDir.getAbsoluteFile()));
+                Main.warn(tr("Failed to initialize preferences. Preference directory ''{0}'' is not a directory.", prefDir.getAbsoluteFile()));
                 JOptionPane.showMessageDialog(
                         Main.parent,
@@ -663,5 +663,5 @@
         } else {
             if (! prefDir.mkdirs()) {
-                System.err.println(tr("Warning: Failed to initialize preferences. Failed to create missing preference directory: {0}", prefDir.getAbsoluteFile()));
+                Main.warn(tr("Failed to initialize preferences. Failed to create missing preference directory: {0}", prefDir.getAbsoluteFile()));
                 JOptionPane.showMessageDialog(
                         Main.parent,
@@ -677,9 +677,9 @@
         try {
             if (!preferenceFile.exists()) {
-                System.out.println(tr("Info: Missing preference file ''{0}''. Creating a default preference file.", preferenceFile.getAbsoluteFile()));
+                Main.info(tr("Missing preference file ''{0}''. Creating a default preference file.", preferenceFile.getAbsoluteFile()));
                 resetToDefault();
                 save();
             } else if (reset) {
-                System.out.println(tr("Warning: Replacing existing preference file ''{0}'' with default preference file.", preferenceFile.getAbsoluteFile()));
+                Main.warn(tr("Replacing existing preference file ''{0}'' with default preference file.", preferenceFile.getAbsoluteFile()));
                 resetToDefault();
                 save();
@@ -712,5 +712,5 @@
             } catch(IOException e1) {
                 e1.printStackTrace();
-                System.err.println(tr("Warning: Failed to initialize preferences. Failed to reset preference file to default: {0}", getPreferenceFile()));
+                Main.warn(tr("Failed to initialize preferences. Failed to reset preference file to default: {0}", getPreferenceFile()));
             }
         }
@@ -906,6 +906,6 @@
             try {
                 save();
-            } catch(IOException e){
-                System.out.println(tr("Warning: failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile()));
+            } catch (IOException e){
+                Main.warn(tr("Failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile()));
             }
         }
@@ -1006,6 +1006,6 @@
             try {
                 save();
-            } catch(IOException e){
-                System.out.println(tr("Warning: failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile()));
+            } catch (IOException e){
+                Main.warn(tr("Failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile()));
             }
         }
@@ -1075,6 +1075,6 @@
             try {
                 save();
-            } catch(IOException e){
-                System.out.println(tr("Warning: failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile()));
+            } catch (IOException e) {
+                Main.warn(tr("Failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile()));
             }
         }
@@ -1657,10 +1657,11 @@
         for (String key : obsolete) {
             boolean removed = false;
-            if(properties.containsKey(key)) { properties.remove(key); removed = true; }
-            if(collectionProperties.containsKey(key)) { collectionProperties.remove(key); removed = true; }
-            if(arrayProperties.containsKey(key)) { arrayProperties.remove(key); removed = true; }
-            if(listOfStructsProperties.containsKey(key)) { listOfStructsProperties.remove(key); removed = true; }
-            if(removed)
-                System.out.println(tr("Preference setting {0} has been removed since it is no longer used.", key));
+            if (properties.containsKey(key)) { properties.remove(key); removed = true; }
+            if (collectionProperties.containsKey(key)) { collectionProperties.remove(key); removed = true; }
+            if (arrayProperties.containsKey(key)) { arrayProperties.remove(key); removed = true; }
+            if (listOfStructsProperties.containsKey(key)) { listOfStructsProperties.remove(key); removed = true; }
+            if (removed) {
+                Main.info(tr("Preference setting {0} has been removed since it is no longer used.", key));
+            }
         }
     }
Index: /trunk/src/org/openstreetmap/josm/data/ServerSidePreferences.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/ServerSidePreferences.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/data/ServerSidePreferences.java	(revision 6248)
@@ -47,5 +47,5 @@
         public String download() throws MissingPassword {
             try {
-                System.out.println("reading preferences from "+serverUrl);
+                Main.info("reading preferences from "+serverUrl);
                 URLConnection con = serverUrl.openConnection();
                 String username = get("applet.username");
@@ -80,5 +80,5 @@
             try {
                 URL u = new URL(getPreferencesDir());
-                System.out.println("uploading preferences to "+u);
+                Main.info("uploading preferences to "+u);
                 HttpURLConnection con = (HttpURLConnection)u.openConnection();
                 String username = get("applet.username");
Index: /trunk/src/org/openstreetmap/josm/data/Version.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/Version.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/data/Version.java	(revision 6248)
@@ -48,5 +48,5 @@
             s = sb.toString();
         } catch (IOException e) {
-            System.err.println(tr("Failed to load resource ''{0}'', error is {1}.", resource.toString(), e.toString()));
+            Main.error(tr("Failed to load resource ''{0}'', error is {1}.", resource.toString(), e.toString()));
             e.printStackTrace();
         }
@@ -114,5 +114,5 @@
             } catch(NumberFormatException e) {
                 version = 0;
-                System.err.println(tr("Warning: unexpected JOSM version number in revision file, value is ''{0}''", value));
+                Main.warn(tr("Unexpected JOSM version number in revision file, value is ''{0}''", value));
             }
         } else {
@@ -158,5 +158,5 @@
         URL u = Main.class.getResource("/REVISION");
         if (u == null) {
-            System.err.println(tr("Warning: the revision file ''/REVISION'' is missing."));
+            Main.warn(tr("The revision file ''/REVISION'' is missing."));
             version = 0;
             releaseDescription = "";
Index: /trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/coor/LatLon.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/data/coor/LatLon.java	(revision 6248)
@@ -254,5 +254,5 @@
         // (This should almost never happen.)
         if (java.lang.Double.isNaN(d)) {
-            System.err.println("Error: NaN in greatCircleDistance");
+            Main.error("NaN in greatCircleDistance");
             d = PI * R;
         }
Index: /trunk/src/org/openstreetmap/josm/data/imagery/GeorefImage.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/imagery/GeorefImage.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/data/imagery/GeorefImage.java	(revision 6248)
@@ -148,7 +148,7 @@
             }
             long freeMem = Runtime.getRuntime().maxMemory() - Runtime.getRuntime().totalMemory();
-            //System.out.println("Free Memory:           "+ (freeMem/1024/1024) +" MB");
+            //Main.debug("Free Memory:           "+ (freeMem/1024/1024) +" MB");
             // Notice that this value can get negative due to integer overflows
-            //System.out.println("Img Size:              "+ (width*height*3/1024/1024) +" MB");
+            //Main.debug("Img Size:              "+ (width*height*3/1024/1024) +" MB");
 
             int multipl = alphaChannel ? 4 : 3;
Index: /trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java	(revision 6248)
@@ -229,5 +229,5 @@
                     }
                 } catch (IllegalArgumentException ex) {
-                    Main.warn(ex.toString());
+                    Main.warn(ex);
                 }
             }
Index: /trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java	(revision 6248)
@@ -9,6 +9,4 @@
 import java.util.List;
 
-import org.xml.sax.SAXException;
-
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryPreferenceEntry;
@@ -16,4 +14,5 @@
 import org.openstreetmap.josm.io.imagery.ImageryReader;
 import org.openstreetmap.josm.tools.Utils;
+import org.xml.sax.SAXException;
 
 /**
@@ -50,5 +49,5 @@
                     add(i);
                 } catch (IllegalArgumentException e) {
-                    System.err.println("Warning: Unable to load imagery preference entry:"+e);
+                    Main.warn("Unable to load imagery preference entry:"+e);
                 }
             }
Index: /trunk/src/org/openstreetmap/josm/data/imagery/OffsetBookmark.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/imagery/OffsetBookmark.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/data/imagery/OffsetBookmark.java	(revision 6248)
@@ -56,5 +56,5 @@
         }
         if (projectionCode == null) {
-            System.err.println(tr("Projection ''{0}'' is not found, bookmark ''{1}'' is not usable", projectionCode, name));
+            Main.error(tr("Projection ''{0}'' is not found, bookmark ''{1}'' is not usable", projectionCode, name));
         }
     }
Index: /trunk/src/org/openstreetmap/josm/data/imagery/WmsCache.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/imagery/WmsCache.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/data/imagery/WmsCache.java	(revision 6248)
@@ -123,7 +123,7 @@
                 layersIndex.load(fis);
             } catch (FileNotFoundException e) {
-                System.out.println("Unable to load layers index for wms cache (file " + layerIndexFile + " not found)");
+                Main.error("Unable to load layers index for wms cache (file " + layerIndexFile + " not found)");
             } catch (IOException e) {
-                System.err.println("Unable to load layers index for wms cache");
+                Main.error("Unable to load layers index for wms cache");
                 e.printStackTrace();
             }
@@ -151,5 +151,5 @@
                     layersIndex.store(fos, "");
                 } catch (IOException e) {
-                    System.err.println("Unable to save layer index for wms cache");
+                    Main.error("Unable to save layer index for wms cache");
                     e.printStackTrace();
                 }
@@ -187,5 +187,5 @@
             totalFileSize = cacheEntries.getTotalFileSize();
             if (cacheEntries.getTileSize() != tileSize) {
-                System.out.println("Cache created with different tileSize, cache will be discarded");
+                Main.info("Cache created with different tileSize, cache will be discarded");
                 return;
             }
@@ -202,7 +202,7 @@
             if (indexFile.exists()) {
                 e.printStackTrace();
-                System.out.println("Unable to load index for wms-cache, new file will be created");
+                Main.info("Unable to load index for wms-cache, new file will be created");
             } else {
-                System.out.println("Index for wms-cache doesn't exist, new file will be created");
+                Main.info("Index for wms-cache doesn't exist, new file will be created");
             }
         }
@@ -297,5 +297,5 @@
             marshaller.marshal(index, new FileOutputStream(new File(cacheDir, INDEX_FILENAME)));
         } catch (Exception e) {
-            System.err.println("Failed to save wms-cache file");
+            Main.error("Failed to save wms-cache file");
             e.printStackTrace();
         }
@@ -364,5 +364,5 @@
                 return loadImage(projectionEntries, entry);
             } catch (IOException e) {
-                System.err.println("Unable to load file from wms cache");
+                Main.error("Unable to load file from wms cache");
                 e.printStackTrace();
                 return null;
Index: /trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 6248)
@@ -799,5 +799,5 @@
         OsmPrimitive result = getPrimitiveById(primitiveId);
         if (result == null) {
-            System.out.println(tr("JOSM expected to find primitive [{0} {1}] in dataset but it is not there. Please report this "
+            Main.warn(tr("JOSM expected to find primitive [{0} {1}] in dataset but it is not there. Please report this "
                     + "at http://josm.openstreetmap.de/. This is not a critical error, it should be safe to continue in your work.",
                     primitiveId.getType(), Long.toString(primitiveId.getUniqueId())));
Index: /trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 6248)
@@ -745,5 +745,5 @@
             reversedDirectionKeys = SearchCompiler.compile(Main.pref.get("tags.reversed_direction", reversedDirectionDefault), false, false);
         } catch (ParseError e) {
-            System.err.println("Unable to compile pattern for tags.reversed_direction, trying default pattern: " + e.getMessage());
+            Main.error("Unable to compile pattern for tags.reversed_direction, trying default pattern: " + e.getMessage());
 
             try {
@@ -756,5 +756,5 @@
             directionKeys = SearchCompiler.compile(Main.pref.get("tags.direction", directionDefault), false, false);
         } catch (ParseError e) {
-            System.err.println("Unable to compile pattern for tags.direction, trying default pattern: " + e.getMessage());
+            Main.error("Unable to compile pattern for tags.direction, trying default pattern: " + e.getMessage());
 
             try {
Index: /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapRendererFactory.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapRendererFactory.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapRendererFactory.java	(revision 6248)
@@ -106,5 +106,5 @@
             }
         }
-        System.err.println(tr("Error: failed to load map renderer class ''{0}''. The class wasn''t found.", className));
+        Main.error(tr("Failed to load map renderer class ''{0}''. The class wasn''t found.", className));
         return null;
     }
@@ -126,16 +126,16 @@
         Class<?> c = loadRendererClass(rendererClassName);
         if (c == null){
-            System.err.println(tr("Can''t activate map renderer class ''{0}'', because the class wasn''t found.", rendererClassName));
-            System.err.println(tr("Activating the standard map renderer instead."));
+            Main.error(tr("Can''t activate map renderer class ''{0}'', because the class wasn''t found.", rendererClassName));
+            Main.error(tr("Activating the standard map renderer instead."));
             activateDefault();
         } else if (! AbstractMapRenderer.class.isAssignableFrom(c)) {
-            System.err.println(tr("Can''t activate map renderer class ''{0}'', because it isn''t a subclass of ''{1}''.", rendererClassName, AbstractMapRenderer.class.getName()));
-            System.err.println(tr("Activating the standard map renderer instead."));
+            Main.error(tr("Can''t activate map renderer class ''{0}'', because it isn''t a subclass of ''{1}''.", rendererClassName, AbstractMapRenderer.class.getName()));
+            Main.error(tr("Activating the standard map renderer instead."));
             activateDefault();
         } else {
             Class<? extends AbstractMapRenderer> renderer = c.asSubclass(AbstractMapRenderer.class);
             if (! isRegistered(renderer)) {
-                System.err.println(tr("Can''t activate map renderer class ''{0}'', because it isn''t registered as map renderer.", rendererClassName));
-                System.err.println(tr("Activating the standard map renderer instead."));
+                Main.error(tr("Can''t activate map renderer class ''{0}'', because it isn''t registered as map renderer.", rendererClassName));
+                Main.error(tr("Activating the standard map renderer instead."));
                 activateDefault();
             } else {
Index: /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java	(revision 6248)
@@ -1403,5 +1403,4 @@
     @Override
     public void render(final DataSet data, boolean renderVirtualNodes, Bounds bounds) {
-        //long start = System.currentTimeMillis();
         BBox bbox = bounds.toBBox();
         getSettings(renderVirtualNodes);
@@ -1420,11 +1419,7 @@
         collectWayStyles(data, sc, bbox);
         collectRelationStyles(data, sc, bbox);
-        //long phase1 = System.currentTimeMillis();
         sc.drawAll();
         sc = null;
         drawVirtualNodes(data, bbox);
-
-        //long now = System.currentTimeMillis();
-        //System.err.println(String.format("PAINTING TOOK %d [PHASE1 took %d] (at scale %s)", now - start, phase1 - start, circum));
     }
 }
Index: /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java	(revision 6248)
@@ -292,5 +292,5 @@
                 if (ds == null) {
                     // DataSet still not found. This should not happen, but a warning does no harm
-                    System.err.println("Warning: DataSet not found while resetting nodes in Multipolygon. This should not happen, you may report it to JOSM developers.");
+                    Main.warn("DataSet not found while resetting nodes in Multipolygon. This should not happen, you may report it to JOSM developers.");
                 } else if (wayIds.size() == 1) {
                     Way w = (Way) ds.getPrimitiveById(wayIds.iterator().next(), OsmPrimitiveType.WAY);
Index: /trunk/src/org/openstreetmap/josm/data/projection/AbstractProjection.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/projection/AbstractProjection.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/data/projection/AbstractProjection.java	(revision 6248)
@@ -104,14 +104,3 @@
         return degree + (minute/60.0) + (second/3600.0);
     }
-
-    public void dump() {
-        System.err.println("x_0="+x_0);
-        System.err.println("y_0="+y_0);
-        System.err.println("lon_0="+lon_0);
-        System.err.println("k_0="+k_0);
-        System.err.println("ellps="+ellps);
-        System.err.println("proj="+proj);
-        System.err.println("datum="+datum);
-    }
-
 }
Index: /trunk/src/org/openstreetmap/josm/data/projection/Projections.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/projection/Projections.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/data/projection/Projections.java	(revision 6248)
@@ -138,5 +138,5 @@
                         inits.put("EPSG:" + m.group(1), Pair.create(name, m.group(2).trim()));
                     } else {
-                        System.err.println("Warning: failed to parse line from the epsg projection definition: "+line);
+                        Main.warn("Failed to parse line from the EPSG projection definition: "+line);
                     }
                 }
Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java	(revision 6248)
@@ -259,5 +259,5 @@
                                 checkerData.add(d);
                             } else {
-                                System.err.println(tr("Invalid tagchecker line - {0}: {1}", err, line));
+                                Main.error(tr("Invalid tagchecker line - {0}: {1}", err, line));
                             }
                         }
@@ -267,5 +267,5 @@
                         spellCheckKeyData.put(line.substring(1), okValue);
                     } else {
-                        System.err.println(tr("Invalid spellcheck line: {0}", line));
+                        Main.error(tr("Invalid spellcheck line: {0}", line));
                     }
                 }
@@ -310,5 +310,5 @@
                                 presetsValueData.putAll(ky.key, ky.getValues());
                             } catch (NullPointerException e) {
-                                System.err.println(p+": Unable to initialize "+ky);
+                                Main.error(p+": Unable to initialize "+ky);
                             }
                         }
Index: /trunk/src/org/openstreetmap/josm/gui/BookmarkList.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/BookmarkList.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/BookmarkList.java	(revision 6248)
@@ -112,6 +112,6 @@
                     bookmarks.add(new Bookmark(entry));
                 }
-                catch(Exception e) {
-                    System.err.println(tr("Error reading bookmark entry: %s", e.getMessage()));
+                catch (Exception e) {
+                    Main.error(tr("Error reading bookmark entry: %s", e.getMessage()));
                 }
             }
@@ -126,5 +126,5 @@
                 LinkedList<Bookmark> bookmarks = new LinkedList<Bookmark>();
                 if (bookmarkFile.exists()) {
-                    System.out.println("Try loading obsolete bookmarks file");
+                    Main.info("Try loading obsolete bookmarks file");
                     BufferedReader in = new BufferedReader(new InputStreamReader(
                             new FileInputStream(bookmarkFile), "utf-8"));
@@ -133,5 +133,5 @@
                         Matcher m = Pattern.compile("^(.+)[,\u001e](-?\\d+.\\d+)[,\u001e](-?\\d+.\\d+)[,\u001e](-?\\d+.\\d+)[,\u001e](-?\\d+.\\d+)$").matcher(line);
                         if (!m.matches() || m.groupCount() != 5) {
-                            System.err.println(tr("Error: Unexpected line ''{0}'' in bookmark file ''{1}''",line, bookmarkFile.toString()));
+                            Main.error(tr("Unexpected line ''{0}'' in bookmark file ''{1}''",line, bookmarkFile.toString()));
                             continue;
                         }
@@ -142,6 +142,6 @@
                             try {
                                 values[i] = Double.parseDouble(m.group(i+2));
-                            } catch(NumberFormatException e) {
-                                System.err.println(tr("Error: Illegal double value ''{0}'' on line ''{1}'' in bookmark file ''{2}''",m.group(i+2),line, bookmarkFile.toString()));
+                            } catch (NumberFormatException e) {
+                                Main.error(tr("Illegal double value ''{0}'' on line ''{1}'' in bookmark file ''{2}''",m.group(i+2),line, bookmarkFile.toString()));
                                 continue;
                             }
@@ -156,5 +156,5 @@
                     }
                     save();
-                    System.out.println("Removing obsolete bookmarks file");
+                    Main.info("Removing obsolete bookmarks file");
                     bookmarkFile.delete();
                 }
Index: /trunk/src/org/openstreetmap/josm/gui/GettingStarted.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/GettingStarted.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/GettingStarted.java	(revision 6248)
@@ -130,5 +130,5 @@
                         content = new MotdContent().updateIfRequiredString();
                     } catch (IOException ex) {
-                        System.out.println(tr("Warning: failed to read MOTD. Exception was: {0}", ex.toString()));
+                        Main.warn(tr("Failed to read MOTD. Exception was: {0}", ex.toString()));
                         content = "<html>" + STYLE + "<h1>" + "JOSM - " + tr("Java OpenStreetMap Editor")
                                 + "</h1>\n<h2 align=\"center\">(" + tr("Message of the day not available") + ")</h2></html>";
Index: /trunk/src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 6248)
@@ -320,5 +320,5 @@
             CustomConfigurator.XMLCommandProcessor config = new CustomConfigurator.XMLCommandProcessor(Main.pref);
             for (String i : args.get(Option.LOAD_PREFERENCES)) {
-                System.out.println("Reading preferences from " + i);
+                info("Reading preferences from " + i);
                 try {
                     config.openAndReadXML(Utils.openURL(new URL(i)));
@@ -446,5 +446,5 @@
         if (Main.pref.getBoolean("debug.edt-checker.enable", Version.getInstance().isLocalBuild())) {
             // Repaint manager is registered so late for a reason - there is lots of violation during startup process but they don't seem to break anything and are difficult to fix
-            System.out.println("Enabled EDT checker, wrongful access to gui from non EDT thread will be printed to console");
+            info("Enabled EDT checker, wrongful access to gui from non EDT thread will be printed to console");
             RepaintManager.setCurrentManager(new CheckThreadViolationRepaintManager());
         }
Index: /trunk/src/org/openstreetmap/josm/gui/MapStatus.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 6248)
@@ -130,5 +130,5 @@
         public void appendLogMessage(String message) {
             if (message != null && !message.isEmpty()) {
-                System.out.println("appendLogMessage not implemented for background tasks. Message was: " + message);
+                Main.info("appendLogMessage not implemented for background tasks. Message was: " + message);
             }
         }
Index: /trunk/src/org/openstreetmap/josm/gui/MultiSplitLayout.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MultiSplitLayout.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/MultiSplitLayout.java	(revision 6248)
@@ -31,5 +31,4 @@
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyChangeSupport;
-import java.io.IOException;
 import java.io.Reader;
 import java.io.StreamTokenizer;
@@ -45,4 +44,5 @@
 import javax.swing.UIManager;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -1263,5 +1263,5 @@
         }
         catch (Exception e) {
-            System.err.println(e);
+            Main.error(e);
         }
         finally {
@@ -1320,23 +1320,3 @@
         return parseModel(new StringReader(s));
     }
-
-    private static void printModel(String indent, Node root) {
-        if (root instanceof Split) {
-            Split split = (Split)root;
-            System.out.println(indent + split);
-            for(Node child : split.getChildren()) {
-                printModel(indent + "  ", child);
-            }
-        }
-        else {
-            System.out.println(indent + root);
-        }
-    }
-
-    /**
-     * Print the tree with enough detail for simple debugging.
-     */
-    public static void printModel(Node root) {
-        printModel("", root);
-    }
 }
Index: /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 6248)
@@ -860,6 +860,4 @@
 
                     if (perDistSq < snapDistanceSq && a < c + snapDistanceSq && b < c + snapDistanceSq) {
-                        //System.err.println(Double.toHexString(perDistSq));
-
                         List<WaySegment> wslist;
                         if (nearestMap.containsKey(perDistSq)) {
Index: /trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java	(revision 6248)
@@ -69,5 +69,5 @@
  *            // listen for BBOX events
  *            if (evt.getPropertyName().equals(BBoxChooser.BBOX_PROP)) {
- *               System.out.println("new bbox based on OSM tiles selected: " + (Bounds)evt.getNewValue());
+ *               Main.info("new bbox based on OSM tiles selected: " + (Bounds)evt.getNewValue());
  *            }
  *        }
Index: /trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMergeModel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMergeModel.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMergeModel.java	(revision 6248)
@@ -719,5 +719,5 @@
                 return ((RelationMember)value).getMember();
             } else {
-                System.err.println("Unknown object type: "+value);
+                Main.error("Unknown object type: "+value);
                 return null;
             }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java	(revision 6248)
@@ -317,5 +317,5 @@
     @Override
     public void onConflictsRemoved(ConflictCollection conflicts) {
-        System.err.println("1 conflict has been resolved.");
+        Main.info("1 conflict has been resolved.");
         refreshView();
     }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java	(revision 6248)
@@ -204,5 +204,5 @@
         }
         if (!toReload.isEmpty()) {
-            System.out.println(trn("Reloading {0} map style.", "Reloading {0} map styles.", toReload.size(), toReload.size()));
+            Main.info(trn("Reloading {0} map style.", "Reloading {0} map styles.", toReload.size(), toReload.size()));
             Main.worker.submit(new MapPaintStyleLoader(toReload));
         }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 6248)
@@ -846,5 +846,5 @@
                         buttonActions.add(action);
                     } else {
-                        System.err.println("Button " + button + " doesn't have action defined");
+                        Main.warn("Button " + button + " doesn't have action defined");
                         new Exception().printStackTrace();
                     }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java	(revision 6248)
@@ -203,5 +203,5 @@
             if (users.isEmpty()) return;
             if (users.size() > 10) {
-                System.out.println(tr("Warning: only launching info browsers for the first {0} of {1} selected users", 10, users.size()));
+                Main.warn(tr("Only launching info browsers for the first {0} of {1} selected users", 10, users.size()));
             }
             int num = Math.min(10, users.size());
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/BasicChangesetQueryPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/BasicChangesetQueryPanel.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/BasicChangesetQueryPanel.java	(revision 6248)
@@ -191,5 +191,5 @@
                 q = BasicQuery.valueOf(BasicQuery.class, value);
             } catch(IllegalArgumentException e) {
-                System.err.println(tr("Warning: unexpected value for preference ''{0}'', got ''{1}''. Resetting to default query.","changeset-query.basic.query", value));
+                Main.warn(tr("Unexpected value for preference ''{0}'', got ''{1}''. Resetting to default query.","changeset-query.basic.query", value));
                 q = BasicQuery.MOST_RECENT_CHANGESETS;
             }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java	(revision 6248)
@@ -428,6 +428,5 @@
             } catch (Exception e) {
                 if (canceled) {
-                    System.out.println(tr("Warning: Ignoring exception because task was canceled. Exception: {0}", e
-                            .toString()));
+                    Main.warn(tr("Ignoring exception because task was canceled. Exception: {0}", e.toString()));
                     return;
                 }
@@ -521,6 +520,5 @@
             } catch (Exception e) {
                 if (canceled) {
-                    System.out.println(tr("Warning: Ignoring exception because task was canceled. Exception: {0}", e
-                            .toString()));
+                    Main.warn(tr("Ignoring exception because task was canceled. Exception: {0}", e.toString()));
                     return;
                 }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationMemberTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationMemberTask.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationMemberTask.java	(revision 6248)
@@ -145,6 +145,5 @@
         } catch (Exception e) {
             if (canceled) {
-                System.out.println(tr("Warning: Ignoring exception because task was canceled. Exception: {0}", e
-                        .toString()));
+                Main.warn(tr("Ignoring exception because task was canceled. Exception: {0}", e.toString()));
                 return;
             }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationTask.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationTask.java	(revision 6248)
@@ -108,6 +108,5 @@
         } catch (Exception e) {
             if (canceled) {
-                System.out.println(tr("Warning: Ignoring exception because task was canceled. Exception: {0}", e
-                        .toString()));
+                Main.warn(tr("Ignoring exception because task was canceled. Exception: {0}", e.toString()));
                 return;
             }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java	(revision 6248)
@@ -193,5 +193,5 @@
         } catch(Exception e) {
             if (canceled) {
-                System.out.println(tr("Warning: Ignoring exception because task was canceled. Exception: {0}", e.toString()));
+                Main.warn(tr("Ignoring exception because task was canceled. Exception: {0}", e.toString()));
                 return;
             }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTree.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTree.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTree.java	(revision 6248)
@@ -159,5 +159,5 @@
             } catch(Exception e) {
                 if (canceled) {
-                    System.out.println(tr("Warning: Ignoring exception because task was canceled. Exception: {0}", e.toString()));
+                    Main.warn(tr("Ignoring exception because task was canceled. Exception: {0}", e.toString()));
                     return;
                 }
Index: /trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java	(revision 6248)
@@ -145,5 +145,5 @@
             }
         } catch(Exception e) {
-            System.err.println(tr("Failed to read CSS file ''help-browser.css''. Exception is: {0}", e.toString()));
+            Main.error(tr("Failed to read CSS file ''help-browser.css''. Exception is: {0}", e.toString()));
             e.printStackTrace();
             return ss;
@@ -499,5 +499,4 @@
         @Override
         public void update(Observable o, Object arg) {
-            //System.out.println("BackAction: canGoBoack=" + history.canGoBack() );
             setEnabled(history.canGoBack());
         }
@@ -559,6 +558,6 @@
                         return true;
                     }
-                } catch(BadLocationException e) {
-                    System.err.println(tr("Warning: bad location in HTML document. Exception was: {0}", e.toString()));
+                } catch (BadLocationException e) {
+                    Main.warn(tr("Bad location in HTML document. Exception was: {0}", e.toString()));
                     e.printStackTrace();
                 }
Index: /trunk/src/org/openstreetmap/josm/gui/io/AbstractUploadTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/io/AbstractUploadTask.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/io/AbstractUploadTask.java	(revision 6248)
@@ -265,5 +265,5 @@
             }
         }
-        System.out.println(tr("Warning: error header \"{0}\" did not match with an expected pattern", errorHeader));
+        Main.warn(tr("Error header \"{0}\" did not match with an expected pattern", errorHeader));
         handleUploadConflictForUnknownConflict();
     }
@@ -280,5 +280,5 @@
             handleUploadPreconditionFailedConflict(e, conflict);
         } else {
-            System.out.println(tr("Warning: error header \"{0}\" did not match with an expected pattern", e.getErrorHeader()));
+            Main.warn(tr("Error header \"{0}\" did not match with an expected pattern", e.getErrorHeader()));
             ExceptionDialogUtil.explainPreconditionFailed(e);
         }
Index: /trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java	(revision 6248)
@@ -106,5 +106,5 @@
             setAlwaysOnTop(true);
         } catch(SecurityException e) {
-            System.out.println(tr("Warning: failed to put Credential Dialog always on top. Caught security exception."));
+            Main.warn(tr("Failed to put Credential Dialog always on top. Caught security exception."));
         }
         build();
Index: /trunk/src/org/openstreetmap/josm/gui/io/DownloadFileTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/io/DownloadFileTask.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/io/DownloadFileTask.java	(revision 6248)
@@ -18,4 +18,5 @@
 import java.util.zip.ZipFile;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.PleaseWaitDialog;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
@@ -121,7 +122,7 @@
             Utils.close(out);
             if (!canceled) {
-                System.out.println(tr("Download finished"));
+                Main.info(tr("Download finished"));
                 if (unpack) {
-                    System.out.println(tr("Unpacking {0} into {1}", file.getAbsolutePath(), file.getParent()));
+                    Main.info(tr("Unpacking {0} into {1}", file.getAbsolutePath(), file.getParent()));
                     unzipFileRecursively(file, file.getParent());
                     file.delete();
@@ -129,6 +130,6 @@
             }
         } catch(MalformedURLException e) {
-            String msg = tr("Warning: Cannot download file ''{0}''. Its download link ''{1}'' is not a valid URL. Skipping download.", file.getName(), address);
-            System.err.println(msg);
+            String msg = tr("Cannot download file ''{0}''. Its download link ''{1}'' is not a valid URL. Skipping download.", file.getName(), address);
+            Main.warn(msg);
             throw new DownloadException(msg);
         } catch (IOException e) {
Index: /trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java	(revision 6248)
@@ -117,5 +117,5 @@
                 im.setPartiallyIdentified(im.getUserName());
             }
-            System.err.println(tr("Warning: Failed to retrieve user infos for the current JOSM user. Exception was: {0}", e.toString()));
+            Main.warn(tr("Failed to retrieve user infos for the current JOSM user. Exception was: {0}", e.toString()));
         }
     }
Index: /trunk/src/org/openstreetmap/josm/gui/io/UploadLayerTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/io/UploadLayerTask.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/io/UploadLayerTask.java	(revision 6248)
@@ -7,4 +7,5 @@
 import java.util.HashSet;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.upload.CyclicUploadDependencyException;
 import org.openstreetmap.josm.data.APIDataSet;
@@ -93,5 +94,5 @@
             // we tried to delete an already deleted primitive.
             //
-            System.out.println(tr("Warning: object ''{0}'' is already deleted on the server. Skipping this object and retrying to upload.", p.getDisplayName(DefaultNameFormatter.getInstance())));
+            Main.warn(tr("Object ''{0}'' is already deleted on the server. Skipping this object and retrying to upload.", p.getDisplayName(DefaultNameFormatter.getInstance())));
             processedPrimitives.addAll(writer.getProcessedPrimitives());
             processedPrimitives.add(p);
@@ -138,5 +139,5 @@
         } catch (Exception sxe) {
             if (isCanceled()) {
-                System.out.println("Ignoring exception caught because upload is canceled. Exception is: " + sxe.toString());
+                Main.info("Ignoring exception caught because upload is canceled. Exception is: " + sxe.toString());
                 return;
             }
Index: /trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java	(revision 6248)
@@ -26,4 +26,5 @@
 import org.openstreetmap.josm.gui.HelpAwareOptionPane;
 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
+import org.openstreetmap.josm.gui.Notification;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
@@ -37,6 +38,4 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.xml.sax.SAXException;
-
-import org.openstreetmap.josm.gui.Notification;
 
 /**
@@ -206,5 +205,5 @@
             }
             monitor.appendLogMessage(msg);
-            System.out.println(tr("Warning: {0}", msg));
+            Main.warn(msg);
             processedPrimitives.addAll(writer.getProcessedPrimitives());
             processedPrimitives.add(p);
@@ -301,5 +300,5 @@
         } catch (Exception e) {
             if (uploadCanceled) {
-                System.out.println(tr("Ignoring caught exception because upload is canceled. Exception is: {0}", e.toString()));
+                Main.info(tr("Ignoring caught exception because upload is canceled. Exception is: {0}", e.toString()));
             } else {
                 lastException = e;
Index: /trunk/src/org/openstreetmap/josm/gui/io/UploadSelectionDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/io/UploadSelectionDialog.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/io/UploadSelectionDialog.java	(revision 6248)
@@ -151,8 +151,4 @@
     public List<OsmPrimitive> getSelectedPrimitives() {
         ArrayList<OsmPrimitive> ret  = new ArrayList<OsmPrimitive>();
-        System.out.println("selected length:" +lstSelectedPrimitives.getSelectedIndices().length);
-        for (int i=0; i< lstSelectedPrimitives.getSelectedIndices().length;i++) {
-            System.out.println("selected:" +lstSelectedPrimitives.getSelectedIndices()[i]);
-        }
         ret.addAll(lstSelectedPrimitives.getOsmPrimitiveListModel().getPrimitives(lstSelectedPrimitives.getSelectedIndices()));
         ret.addAll(lstDeletedPrimitives.getOsmPrimitiveListModel().getPrimitives(lstDeletedPrimitives.getSelectedIndices()));
Index: /trunk/src/org/openstreetmap/josm/gui/io/UploadStrategy.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/io/UploadStrategy.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/io/UploadStrategy.java	(revision 6248)
@@ -86,5 +86,5 @@
         UploadStrategy strategy = fromPreference(v);
         if (strategy == null) {
-            System.err.println(tr("Warning: unexpected value for key ''{0}'' in preferences, got ''{1}''", "osm-server.upload-strategy", v ));
+            Main.warn(tr("Unexpected value for key ''{0}'' in preferences, got ''{1}''", "osm-server.upload-strategy", v ));
             return DEFAULT_UPLOAD_STRATEGY;
         }
Index: /trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java	(revision 6248)
@@ -135,5 +135,4 @@
             }
         }
-        //System.out.println("scanning "+data.tracks.size()+" tracks, found min,max"+min+"--"+max);
         if (min==1e100 || max==-1e100) return null;
         return new Date[]{new Date((long) (min * 1000)), new Date((long) (max * 1000)), };
@@ -425,5 +424,4 @@
          ********** STEP 1 - GET CONFIG VALUES **************************
          ****************************************************************/
-        // Long startTime = System.currentTimeMillis();
         Color neutralColor = getColor(true);
         String spec="layer "+getName();
@@ -788,6 +786,4 @@
             g.setStroke(storedStroke);
         }
-        // Long duration = System.currentTimeMillis() - startTime;
-        // System.out.println(duration);
     } // end paint
 
Index: /trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 6248)
@@ -396,5 +396,5 @@
             data.setVersion(from.getVersion());
         } else if ("0.5".equals(data.getVersion()) ^ "0.5".equals(from.getVersion())) {
-            System.err.println(tr("Warning: mixing 0.6 and 0.5 data results in version 0.5"));
+            Main.warn(tr("Mixing 0.6 and 0.5 data results in version 0.5"));
             data.setVersion("0.5");
         }
Index: /trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java	(revision 6248)
@@ -329,5 +329,5 @@
                 String r = new Scanner(in).useDelimiter("\\A").next();
                 Utils.close(in);
-                System.out.println("Successfully loaded Bing attribution data.");
+                Main.info("Successfully loaded Bing attribution data.");
                 return r.getBytes("utf-8");
             }
@@ -347,5 +347,5 @@
                             return parseAttributionText(new InputSource(new StringReader((xml))));
                         } catch (IOException ex) {
-                            System.err.println("Could not connect to Bing API. Will retry in " + waitTimeSec + " seconds.");
+                            Main.warn("Could not connect to Bing API. Will retry in " + waitTimeSec + " seconds.");
                             Thread.sleep(waitTimeSec * 1000L);
                             waitTimeSec *= 2;
Index: /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 6248)
@@ -1052,12 +1052,12 @@
             delta = Math.round(diff - timezone*60*60); // seconds
 
-            /*System.out.println("phto " + firstExifDate);
-            System.out.println("gpx  " + firstGPXDate);
-            System.out.println("diff " + diff);
-            System.out.println("difh " + diffInH);
-            System.out.println("days " + dayOffset);
-            System.out.println("time " + tz);
-            System.out.println("fix  " + timezone);
-            System.out.println("offt " + delta);*/
+            /*Main.debug("phto " + firstExifDate);
+            Main.debug("gpx  " + firstGPXDate);
+            Main.debug("diff " + diff);
+            Main.debug("difh " + diffInH);
+            Main.debug("days " + dayOffset);
+            Main.debug("time " + tz);
+            Main.debug("fix  " + timezone);
+            Main.debug("offt " + delta);*/
 
             tfTimezone.getDocument().removeDocumentListener(statusBarUpdater);
@@ -1160,5 +1160,5 @@
 
                         } catch(ParseException e) {
-                            System.err.println("Error while parsing date \"" + curWpTimeStr + '"');
+                            Main.error("Error while parsing date \"" + curWpTimeStr + '"');
                             e.printStackTrace();
                             prevWp = null;
Index: /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java	(revision 6248)
@@ -558,5 +558,5 @@
 
         } catch (Exception ex) { // (other exceptions, e.g. #5271)
-            System.err.println("Error reading EXIF from file: "+ex);
+            Main.error("Error reading EXIF from file: "+ex);
             e.setExifCoor(null);
             e.setPos(null);
@@ -651,5 +651,5 @@
 
                 if (toDelete.getFile().delete()) {
-                    System.out.println("File "+toDelete.getFile().toString()+" deleted. ");
+                    Main.info("File "+toDelete.getFile().toString()+" deleted. ");
                 } else {
                     JOptionPane.showMessageDialog(
Index: /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoader.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoader.java	(revision 6248)
@@ -37,5 +37,5 @@
     @Override
     public void run() {
-        System.err.println("Load Thumbnails");
+        Main.debug("Load Thumbnails");
         tracker = new MediaTracker(Main.map.mapView);
         for (int i = 0; i < data.size(); i++) {
@@ -71,6 +71,6 @@
         if (!cacheOff) {
             BufferedImage cached = cache.getImg(cacheIdent);
-            if(cached != null) {
-                System.err.println(" from cache");
+            if (cached != null) {
+                Main.debug(" from cache");
                 return cached;
             }
@@ -82,9 +82,9 @@
             tracker.waitForID(0);
         } catch (InterruptedException e) {
-            System.err.println(" InterruptedException");
+            Main.error(" InterruptedException");
             return null;
         }
         if (tracker.isErrorID(1) || img.getWidth(null) <= 0 || img.getHeight(null) <= 0) {
-            System.err.println(" Invalid image");
+            Main.error(" Invalid image");
             return null;
         }
@@ -104,5 +104,5 @@
 
         if (scaledBI.getWidth() <= 0 || scaledBI.getHeight() <= 0) {
-            System.err.println(" Invalid image");
+            Main.error(" Invalid image");
             return null;
         }
@@ -112,5 +112,4 @@
         }
 
-        System.err.println("");
         return scaledBI;
     }
Index: /trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java	(revision 6248)
@@ -131,5 +131,5 @@
             url = wavFile.toURI().toURL();
         } catch (MalformedURLException e) {
-            System.err.println("Unable to convert filename " + wavFile.getAbsolutePath() + " to URL");
+            Main.error("Unable to convert filename " + wavFile.getAbsolutePath() + " to URL");
         }
         Collection<WayPoint> waypoints = new ArrayList<WayPoint>();
Index: /trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java	(revision 6248)
@@ -291,5 +291,5 @@
             }
         } catch (URISyntaxException e) {
-            Main.warn("URISyntaxException: "+e.getMessage());
+            Main.warn(e);
         }
         return true;
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java	(revision 6248)
@@ -11,4 +11,5 @@
 import java.util.regex.Pattern;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.mappaint.mapcss.CSSColors;
 import org.openstreetmap.josm.tools.Utils;
@@ -49,5 +50,5 @@
         if (res == null) {
             if (!suppressWarnings) {
-                System.err.println(String.format("Warning: unable to convert property %s to type %s: found %s of type %s!", key, klass, o, o.getClass()));
+                Main.warn(String.format("Unable to convert property %s to type %s: found %s of type %s!", key, klass, o, o.getClass()));
             }
             return def;
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 6248)
@@ -100,7 +100,6 @@
                 .setHeight(height)
                 .setOptional(true).get();
-        if(i == null)
-        {
-            System.out.println("Mappaint style \""+namespace+"\" ("+ref.source.getDisplayString()+") icon \"" + ref.iconName + "\" not found.");
+        if (i == null) {
+            Main.warn("Mappaint style \""+namespace+"\" ("+ref.source.getDisplayString()+") icon \"" + ref.iconName + "\" not found.");
             return null;
         }
@@ -243,9 +242,9 @@
                     }
                 }
-                System.err.println("Warning: Could not detect style type. Using default (xml).");
+                Main.warn("Could not detect style type. Using default (xml).");
                 return new XmlStyleSource(entry);
             }
         } catch (IOException e) {
-            System.err.println(tr("Warning: failed to load Mappaint styles from ''{0}''. Exception was: {1}", entry.url, e.toString()));
+            Main.warn(tr("Failed to load Mappaint styles from ''{0}''. Exception was: {1}", entry.url, e.toString()));
             e.printStackTrace();
         } finally {
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java	(revision 6248)
@@ -525,5 +525,5 @@
                 throw new RuntimeException(ex);
             } catch (InvocationTargetException ex) {
-                System.err.println(ex);
+                Main.error(ex);
                 return null;
             }
@@ -574,5 +574,5 @@
                 throw new RuntimeException(ex);
             } catch (InvocationTargetException ex) {
-                System.err.println(ex);
+                Main.error(ex);
                 return null;
             }
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj	(revision 6248)
@@ -27,4 +27,5 @@
 import org.openstreetmap.josm.tools.Pair;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.Main;
 
 public class MapCSSParser {
@@ -573,6 +574,6 @@
     }
     
-    System.err.println("Skipping to the next rule, because of an error:");
-    System.err.println(e);
+    Main.error("Skipping to the next rule, because of an error:");
+    Main.error(e);
     if (sheet != null) {
         sheet.logError(e);
@@ -598,5 +599,5 @@
                 t.image.contains("\n")) {
             ParseException e = new ParseException(String.format("Warning: end of line while reading an unquoted string at line %s column %s.", t.beginLine, t.beginColumn));
-            System.err.println(e);
+            Main.error(e);
             if (sheet != null) {
                 sheet.logError(e);
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 6248)
@@ -15,4 +15,5 @@
 import java.util.zip.ZipFile;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -70,14 +71,14 @@
             loadMeta();
             loadCanvas();
-        } catch(IOException e) {
-            System.err.println(tr("Warning: failed to load Mappaint styles from ''{0}''. Exception was: {1}", url, e.toString()));
+        } catch (IOException e) {
+            Main.warn(tr("Failed to load Mappaint styles from ''{0}''. Exception was: {1}", url, e.toString()));
             e.printStackTrace();
             logError(e);
         } catch (TokenMgrError e) {
-            System.err.println(tr("Warning: failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage()));
+            Main.warn(tr("Failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage()));
             e.printStackTrace();
             logError(e);
         } catch (ParseException e) {
-            System.err.println(tr("Warning: failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage()));
+            Main.warn(tr("Failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage()));
             e.printStackTrace();
             logError(new ParseException(e.getMessage())); // allow e to be garbage collected, it links to the entire token stream
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java	(revision 6248)
@@ -5,4 +5,5 @@
 import java.util.regex.PatternSyntaxException;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -224,5 +225,5 @@
                     if (!c.applies(env)) return false;
                 } catch (PatternSyntaxException e) {
-                    System.err.println("PatternSyntaxException while applying condition" + c +": "+e.getMessage());
+                    Main.error("PatternSyntaxException while applying condition" + c +": "+e.getMessage());
                     return false;
                 }
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/xml/LinePrototype.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/xml/LinePrototype.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/xml/LinePrototype.java	(revision 6248)
@@ -5,4 +5,5 @@
 import java.util.List;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings;
 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors;
@@ -62,5 +63,5 @@
             }
             if (f < 0) {
-                System.err.println(I18n.tr("Illegal dash pattern, values must be positive"));
+                Main.error(I18n.tr("Illegal dash pattern, values must be positive"));
                 this.dashed = null;
                 return;
@@ -70,5 +71,5 @@
             this.dashed = dashed;
         } else {
-            System.err.println(I18n.tr("Illegal dash pattern, at least one value must be > 0"));
+            Main.error(I18n.tr("Illegal dash pattern, at least one value must be > 0"));
         }
     }
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java	(revision 6248)
@@ -4,7 +4,7 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
+import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
-import java.io.IOException;
 import java.util.Collection;
 import java.util.Collections;
@@ -76,14 +76,14 @@
             }
 
-        } catch(IOException e) {
-            System.err.println(tr("Warning: failed to load Mappaint styles from ''{0}''. Exception was: {1}", url, e.toString()));
+        } catch (IOException e) {
+            Main.warn(tr("Failed to load Mappaint styles from ''{0}''. Exception was: {1}", url, e.toString()));
             e.printStackTrace();
             logError(e);
-        } catch(SAXParseException e) {
-            System.err.println(tr("Warning: failed to parse Mappaint styles from ''{0}''. Error was: [{1}:{2}] {3}", url, e.getLineNumber(), e.getColumnNumber(), e.getMessage()));
+        } catch (SAXParseException e) {
+            Main.warn(tr("Failed to parse Mappaint styles from ''{0}''. Error was: [{1}:{2}] {3}", url, e.getLineNumber(), e.getColumnNumber(), e.getMessage()));
             e.printStackTrace();
             logError(e);
-        } catch(SAXException e) {
-            System.err.println(tr("Warning: failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage()));
+        } catch (SAXException e) {
+            Main.warn(tr("Failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage()));
             e.printStackTrace();
             logError(e);
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSourceHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSourceHandler.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSourceHandler.java	(revision 6248)
@@ -73,5 +73,5 @@
     private void error(String message) {
         String warning = style.getDisplayString() + " (" + rule.cond.key + "=" + rule.cond.value + "): " + message;
-        System.err.println(warning);
+        Main.warn(warning);
         style.logError(new Exception(warning));
     }
Index: /trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java	(revision 6248)
@@ -110,13 +110,13 @@
                     con.disconnect();
                 }
-            } catch(NoSuchFieldException e) {
+            } catch (NoSuchFieldException e) {
                 e.printStackTrace();
-                System.err.println(tr("Warning: failed to cancel running OAuth operation"));
-            } catch(SecurityException e) {
+                Main.warn(tr("Failed to cancel running OAuth operation"));
+            } catch (SecurityException e) {
                 e.printStackTrace();
-                System.err.println(tr("Warning: failed to cancel running OAuth operation"));
-            } catch(IllegalAccessException e) {
+                Main.warn(tr("Failed to cancel running OAuth operation"));
+            } catch (IllegalAccessException e) {
                 e.printStackTrace();
-                System.err.println(tr("Warning: failed to cancel running OAuth operation"));
+                Main.warn(tr("Failed to cancel running OAuth operation"));
             }
         }
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 6248)
@@ -1247,5 +1247,5 @@
                         Matcher m = Pattern.compile("^\t([^:]+): *(.+)$").matcher(line);
                         if (! m.matches()) {
-                            System.err.println(tr(getStr(I18nString.ILLEGAL_FORMAT_OF_ENTRY), url, line));
+                            Main.error(tr(getStr(I18nString.ILLEGAL_FORMAT_OF_ENTRY), url, line));
                             continue;
                         }
@@ -1291,5 +1291,5 @@
                             sources.add(last = new ExtendedSourceEntry(m.group(1), m.group(2)));
                         } else {
-                            System.err.println(tr(getStr(I18nString.ILLEGAL_FORMAT_OF_ENTRY), url, line));
+                            Main.error(tr(getStr(I18nString.ILLEGAL_FORMAT_OF_ENTRY), url, line));
                         }
                     }
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEntry.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEntry.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEntry.java	(revision 6248)
@@ -7,4 +7,6 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+
+import org.openstreetmap.josm.Main;
 
 /**
@@ -127,5 +129,5 @@
             return m.group(1);
         } else {
-            System.err.println("Warning: Unexpected URL format: "+url);
+            Main.warn("Unexpected URL format: "+url);
             return url;
         }
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 6248)
@@ -904,10 +904,10 @@
                     Object tb = action.getValue("toolbar");
                     if(tb == null) {
-                        System.out.println(tr("Toolbar action without name: {0}",
+                        Main.info(tr("Toolbar action without name: {0}",
                         action.getClass().getName()));
                         continue;
                     } else if (!(tb instanceof String)) {
                         if(!(tb instanceof Boolean) || (Boolean)tb) {
-                            System.out.println(tr("Strange toolbar value: {0}",
+                            Main.info(tr("Strange toolbar value: {0}",
                             action.getClass().getName()));
                         }
@@ -917,5 +917,5 @@
                         Action r = actions.get(toolbar);
                         if(r != null && r != action && !toolbar.startsWith("imagery_")) {
-                            System.out.println(tr("Toolbar action {0} overwritten: {1} gets {2}",
+                            Main.info(tr("Toolbar action {0} overwritten: {1} gets {2}",
                             toolbar, r.getClass().getName(), action.getClass().getName()));
                         }
@@ -988,5 +988,5 @@
                     result.add(a);
                 } else {
-                    System.out.println("Could not load tool definition "+s);
+                    Main.info("Could not load tool definition "+s);
                 }
             }
@@ -1001,11 +1001,11 @@
     public Action register(Action action) {
         String toolbar = (String) action.getValue("toolbar");
-        if(toolbar == null) {
-            System.out.println(tr("Registered toolbar action without name: {0}",
+        if (toolbar == null) {
+            Main.info(tr("Registered toolbar action without name: {0}",
             action.getClass().getName()));
         } else {
             Action r = regactions.get(toolbar);
-            if(r != null) {
-                System.out.println(tr("Registered toolbar action {0} overwritten: {1} gets {2}",
+            if (r != null) {
+                Main.info(tr("Registered toolbar action {0} overwritten: {1} gets {2}",
                 toolbar, r.getClass().getName(), action.getClass().getName()));
             }
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java	(revision 6248)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.preferences.advanced;
 
+import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
-import static org.openstreetmap.josm.tools.I18n.marktr;
 
 import java.awt.Dimension;
@@ -17,6 +17,6 @@
 import java.util.Map;
 import java.util.Map.Entry;
+
 import javax.swing.AbstractAction;
-
 import javax.swing.Box;
 import javax.swing.JButton;
@@ -356,7 +356,7 @@
                    if (idx>=0) {
                         String t=s.substring(0,idx);
-                        System.out.println(t);
-                        if (profileTypes.containsKey(t))
+                        if (profileTypes.containsKey(t)) {
                             p.add(new ImportProfileAction(s, f, t));
+                        }
                    }
                 }
@@ -366,6 +366,7 @@
                    if (idx>=0) {
                         String t=s.substring(0,idx);
-                        if (profileTypes.containsKey(t))
+                        if (profileTypes.containsKey(t)) {
                             p.add(new ImportProfileAction(s, f, t));
+                        }
                    }
                 }
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ExportProfileAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ExportProfileAction.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ExportProfileAction.java	(revision 6248)
@@ -1,4 +1,6 @@
 // License: GPL. See LICENSE file for details.
 package org.openstreetmap.josm.gui.preferences.advanced;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
 
 import java.awt.event.ActionEvent;
@@ -6,8 +8,10 @@
 import java.util.ArrayList;
 import java.util.Map;
+
 import javax.swing.AbstractAction;
 import javax.swing.JFileChooser;
 import javax.swing.JOptionPane;
 import javax.swing.filechooser.FileFilter;
+
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.DiskAccessAction;
@@ -15,6 +19,4 @@
 import org.openstreetmap.josm.data.Preferences;
 import org.openstreetmap.josm.data.Preferences.Setting;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
 
 /**
@@ -70,6 +72,5 @@
             if (!sel.getName().endsWith(".xml")) sel=new File(sel.getAbsolutePath()+".xml");
             if (!sel.getName().startsWith(schemaKey)) {
-                System.out.println(sel.getParentFile().getAbsolutePath()+"/"+schemaKey+"_"+sel.getName());
-                sel =new File(sel.getParentFile().getAbsolutePath()+"/"+schemaKey+"_"+sel.getName());
+                sel = new File(sel.getParentFile().getAbsolutePath()+"/"+schemaKey+"_"+sel.getName());
             }
             return sel;
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java	(revision 6248)
@@ -22,4 +22,5 @@
 import javax.swing.JScrollPane;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.gui.bbox.SlippyMapBBoxChooser;
@@ -83,6 +84,5 @@
                     JOptionPane.showMessageDialog(getParent(), tr("Could not parse WMS layer list."),
                             tr("WMS Error"), JOptionPane.ERROR_MESSAGE);
-                    System.err.println("Could not parse WMS layer list. Incoming data:");
-                    System.err.println(ex.getIncomingData());
+                    Main.error("Could not parse WMS layer list. Incoming data:\n"+ex.getIncomingData());
                 }
             }
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java	(revision 6248)
@@ -84,5 +84,5 @@
                             canLoad = true;
                         } catch (IOException e) {
-                            System.err.println(tr("Warning: Could not read tagging preset source: {0}", source));
+                            Main.warn(tr("Could not read tagging preset source: {0}", source));
                             ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Error"),
                                     new String[] {tr("Yes"), tr("No"), tr("Cancel")});
@@ -108,5 +108,5 @@
                             // Should not happen, but at least show message
                             String msg = tr("Could not read tagging preset source {0}", source);
-                            System.err.println(msg);
+                            Main.error(msg);
                             JOptionPane.showMessageDialog(Main.parent, msg);
                             return false;
@@ -135,5 +135,5 @@
 
                         if (errorMessage != null) {
-                            System.err.println("Error: "+errorMessage);
+                            Main.error(errorMessage);
                             int result = JOptionPane.showConfirmDialog(Main.parent, new JLabel(errorMessage), tr("Error"),
                                     JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.ERROR_MESSAGE);
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java	(revision 6248)
@@ -104,5 +104,5 @@
             rbOAuth.setSelected(true);
         } else {
-            System.err.println(tr("Warning: Unsupported value in preference ''{0}'', got ''{1}''. Using authentication method ''Basic Authentication''.", "osm-server.auth-method", authMethod));
+            Main.warn(tr("Unsupported value in preference ''{0}'', got ''{1}''. Using authentication method ''Basic Authentication''.", "osm-server.auth-method", authMethod));
             rbBasicAuthentication.setSelected(true);
         }
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java	(revision 6248)
@@ -15,4 +15,5 @@
 import javax.swing.JPanel;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.widgets.JosmPasswordField;
 import org.openstreetmap.josm.gui.widgets.JosmTextField;
@@ -103,6 +104,6 @@
         } catch(CredentialsAgentException e) {
             e.printStackTrace();
-            System.err.println(tr("Warning: failed to retrieve OSM credentials from credential manager."));
-            System.err.println(tr("Current credential manager is of type ''{0}''", cm.getClass().getName()));
+            Main.warn(tr("Failed to retrieve OSM credentials from credential manager."));
+            Main.warn(tr("Current credential manager is of type ''{0}''", cm.getClass().getName()));
             tfOsmUserName.setText("");
             tfOsmPassword.setText("");
@@ -118,8 +119,8 @@
             );
             cm.store(RequestorType.SERVER, OsmApi.getOsmApi().getHost(), pa);
-        } catch(CredentialsAgentException e) {
+        } catch (CredentialsAgentException e) {
             e.printStackTrace();
-            System.err.println(tr("Warning: failed to save OSM credentials to credential manager."));
-            System.err.println(tr("Current credential manager is of type ''{0}''", cm.getClass().getName()));
+            Main.warn(tr("Failed to save OSM credentials to credential manager."));
+            Main.warn(tr("Current credential manager is of type ''{0}''", cm.getClass().getName()));
         }
     }
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAccessTokenHolder.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAccessTokenHolder.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAccessTokenHolder.java	(revision 6248)
@@ -4,4 +4,5 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Preferences;
 import org.openstreetmap.josm.data.oauth.OAuthToken;
@@ -144,6 +145,6 @@
         } catch(CredentialsAgentException e) {
             e.printStackTrace();
-            System.err.println(tr("Warning: Failed to retrieve OAuth Access Token from credential manager"));
-            System.err.println(tr("Current credential manager is of type ''{0}''", cm.getClass().getName()));
+            Main.warn(tr("Failed to retrieve OAuth Access Token from credential manager"));
+            Main.warn(tr("Current credential manager is of type ''{0}''", cm.getClass().getName()));
         }
         saveToPreferences = pref.getBoolean("oauth.access-token.save-to-preferences", true);
@@ -175,6 +176,6 @@
         } catch(CredentialsAgentException e){
             e.printStackTrace();
-            System.err.println(tr("Warning: Failed to store OAuth Access Token to credentials manager"));
-            System.err.println(tr("Current credential manager is of type ''{0}''", cm.getClass().getName()));
+            Main.warn(tr("Failed to store OAuth Access Token to credentials manager"));
+            Main.warn(tr("Current credential manager is of type ''{0}''", cm.getClass().getName()));
         }
     }
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java	(revision 6248)
@@ -316,5 +316,5 @@
 
         if (pp.equals(ProxyPolicy.USE_SYSTEM_SETTINGS) && ! DefaultProxySelector.willJvmRetrieveSystemProxies()) {
-            System.err.println(tr("Warning: JOSM is configured to use proxies from the system setting, but the JVM is not configured to retrieve them. Resetting preferences to ''No proxy''"));
+            Main.warn(tr("JOSM is configured to use proxies from the system setting, but the JVM is not configured to retrieve them. Resetting preferences to ''No proxy''"));
             pp = ProxyPolicy.NO_PROXY;
             rbProxyPolicy.get(pp).setSelected(true);
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java	(revision 6248)
@@ -1,4 +1,7 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.gui.preferences.shortcut;
+
+import static org.openstreetmap.josm.tools.I18n.marktr;
+import static org.openstreetmap.josm.tools.I18n.tr;
 
 import java.awt.Color;
@@ -9,8 +12,4 @@
 import java.awt.Insets;
 import java.awt.Toolkit;
-
-import static org.openstreetmap.josm.tools.I18n.marktr;
-import static org.openstreetmap.josm.tools.I18n.tr;
-
 import java.awt.event.KeyEvent;
 import java.lang.reflect.Field;
@@ -18,6 +17,6 @@
 import java.util.LinkedHashMap;
 import java.util.Map;
-
 import java.util.regex.PatternSyntaxException;
+
 import javax.swing.AbstractAction;
 import javax.swing.BorderFactory;
@@ -38,14 +37,14 @@
 import javax.swing.event.ListSelectionListener;
 import javax.swing.table.AbstractTableModel;
-import javax.swing.table.TableModel;
 import javax.swing.table.DefaultTableCellRenderer;
 import javax.swing.table.TableColumnModel;
-
+import javax.swing.table.TableModel;
 import javax.swing.table.TableRowSorter;
+
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.widgets.JosmComboBox;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
 import org.openstreetmap.josm.tools.Shortcut;
-import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -117,5 +116,4 @@
                     if (s != null && s.length() > 0 && !s.contains(unknown)) {
                         list.put(Integer.valueOf(i), s);
-                        //System.out.println(i+": "+s);
                     }
                 } catch (Exception e) {
Index: /trunk/src/org/openstreetmap/josm/gui/tagging/TagTable.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/tagging/TagTable.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/tagging/TagTable.java	(revision 6248)
@@ -17,12 +17,7 @@
 import java.util.Collections;
 import java.util.EventObject;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
 import java.util.concurrent.CopyOnWriteArrayList;
 
 import javax.swing.AbstractAction;
-import static javax.swing.Action.SHORT_DESCRIPTION;
-import static javax.swing.Action.SMALL_ICON;
 import javax.swing.CellEditor;
 import javax.swing.DefaultListSelectionModel;
@@ -38,12 +33,12 @@
 import javax.swing.table.TableColumn;
 import javax.swing.text.JTextComponent;
+
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.PasteTagsAction.TagPaster;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Relation;
-
 import org.openstreetmap.josm.gui.dialogs.relation.RunnableAction;
+import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList;
 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager;
-import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList;
 import org.openstreetmap.josm.tools.ImageProvider;
 
@@ -464,5 +459,5 @@
     public void setAutoCompletionManager(AutoCompletionManager autocomplete) {
         if (autocomplete == null) {
-            System.out.println("argument autocomplete should not be null. Aborting.");
+            Main.warn("argument autocomplete should not be null. Aborting.");
             Thread.dumpStack();
             return;
Index: /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java	(revision 6248)
@@ -150,5 +150,5 @@
                     });
                 } else {
-                    System.out.println("Could not get presets icon " + iconName);
+                    Main.warn("Could not get presets icon " + iconName);
                 }
             }
@@ -167,5 +167,5 @@
             this.nameTemplate = new TemplateParser(pattern).parse();
         } catch (ParseError e) {
-            System.err.println("Error while parsing " + pattern + ": " + e.getMessage());
+            Main.error("Error while parsing " + pattern + ": " + e.getMessage());
             throw new SAXException(e);
         }
@@ -176,5 +176,5 @@
             this.nameTemplateFilter = SearchCompiler.compile(filter, false, false);
         } catch (org.openstreetmap.josm.actions.search.SearchCompiler.ParseError e) {
-            System.err.println("Error while parsing" + filter + ": " + e.getMessage());
+            Main.error("Error while parsing" + filter + ": " + e.getMessage());
             throw new SAXException(e);
         }
Index: /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java	(revision 6248)
@@ -626,5 +626,5 @@
                         pnl.add(aibutton, GBC.std());
                     } catch (ParseException x) {
-                        System.err.println("Cannot parse auto-increment value of '" + ai + "' into an integer");
+                        Main.error("Cannot parse auto-increment value of '" + ai + "' into an integer");
                     }
                 }
@@ -673,5 +673,5 @@
             String v = getValue(value);
             if (v == null) {
-                System.err.println("No 'last value' support for component " + value);
+                Main.error("No 'last value' support for component " + value);
                 return;
             }
@@ -921,15 +921,15 @@
             } else {
                 if (values != null) {
-                    System.err.println(tr("Warning in tagging preset \"{0}-{1}\": "
+                    Main.warn(tr("Warning in tagging preset \"{0}-{1}\": "
                             + "Ignoring ''{2}'' attribute as ''{3}'' elements are given.",
                             key, text, "values", "list_entry"));
                 }
                 if (display_values != null || locale_display_values != null) {
-                    System.err.println(tr("Warning in tagging preset \"{0}-{1}\": "
+                    Main.warn(tr("Warning in tagging preset \"{0}-{1}\": "
                             + "Ignoring ''{2}'' attribute as ''{3}'' elements are given.",
                             key, text, "display_values", "list_entry"));
                 }
                 if (short_descriptions != null || locale_short_descriptions != null) {
-                    System.err.println(tr("Warning in tagging preset \"{0}-{1}\": "
+                    Main.warn(tr("Warning in tagging preset \"{0}-{1}\": "
                             + "Ignoring ''{2}'' attribute as ''{3}'' elements are given.",
                             key, text, "short_descriptions", "list_entry"));
@@ -963,9 +963,9 @@
                             value_array = (String[]) method.invoke(null);
                         } else {
-                            System.err.println(tr("Broken tagging preset \"{0}-{1}\" - Java method given in ''values_from'' is not \"{2}\"", key, text,
+                            Main.error(tr("Broken tagging preset \"{0}-{1}\" - Java method given in ''values_from'' is not \"{2}\"", key, text,
                                     "public static String[] methodName()"));
                         }
                     } catch (Exception e) {
-                        System.err.println(tr("Broken tagging preset \"{0}-{1}\" - Java method given in ''values_from'' threw {2} ({3})", key, text,
+                        Main.error(tr("Broken tagging preset \"{0}-{1}\" - Java method given in ''values_from'' threw {2} ({3})", key, text,
                                 e.getClass().getName(), e.getMessage()));
                     }
@@ -984,10 +984,10 @@
 
             if (display_array.length != value_array.length) {
-                System.err.println(tr("Broken tagging preset \"{0}-{1}\" - number of items in ''display_values'' must be the same as in ''values''", key, text));
+                Main.error(tr("Broken tagging preset \"{0}-{1}\" - number of items in ''display_values'' must be the same as in ''values''", key, text));
                 display_array = value_array;
             }
 
             if (short_descriptions_array != null && short_descriptions_array.length != value_array.length) {
-                System.err.println(tr("Broken tagging preset \"{0}-{1}\" - number of items in ''short_descriptions'' must be the same as in ''values''", key, text));
+                Main.error(tr("Broken tagging preset \"{0}-{1}\" - number of items in ''short_descriptions'' must be the same as in ''values''", key, text));
                 short_descriptions_array = null;
             }
Index: /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetReader.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetReader.java	(revision 6248)
@@ -187,6 +187,6 @@
                 allPresets.addAll(readAll(source, validate));
             } catch (IOException e) {
-                System.err.println(e.getClass().getName()+": "+e.getMessage());
-                System.err.println(source);
+                Main.error(e);
+                Main.error(source);
                 JOptionPane.showMessageDialog(
                         Main.parent,
@@ -196,6 +196,6 @@
                         );
             } catch (SAXException e) {
-                System.err.println(e.getClass().getName()+": "+e.getMessage());
-                System.err.println(source);
+                Main.error(e);
+                Main.error(source);
                 JOptionPane.showMessageDialog(
                         Main.parent,
Index: /trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java	(revision 6248)
@@ -291,11 +291,3 @@
         return list == null ? null : getFilteredItem(rowIndex);
     }
-
-    public void dump() {
-        System.out.println("---------------------------------");
-        for (AutoCompletionListItem item: list) {
-            System.out.println(item);
-        }
-        System.out.println("---------------------------------");
-    }
 }
Index: /trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java	(revision 6248)
@@ -12,4 +12,5 @@
 import java.util.Set;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -156,5 +157,5 @@
                             presetTagCache.putAll(ki.key, ki.getValues());
                         } catch (NullPointerException e) {
-                            System.err.println(p+": Unable to cache "+ki);
+                            Main.error(p+": Unable to cache "+ki);
                         }
                     }
Index: /trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java	(revision 6248)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.gui.util;
 
+import static org.openstreetmap.josm.tools.I18n.tr;
+
 import java.awt.BasicStroke;
-import static org.openstreetmap.josm.tools.I18n.tr;
-
 import java.awt.Component;
 import java.awt.Container;
@@ -196,9 +196,9 @@
                 }
             } catch (NumberFormatException ex) {
-                System.err.println("Error in stroke preference format: "+code);
+                Main.error("Error in stroke preference format: "+code);
                 dash = new float[]{5.0f};
             }
             if (sumAbs < 1e-1) {
-                System.err.println("Error in stroke dash fomat (all zeros): "+code);
+                Main.error("Error in stroke dash fomat (all zeros): "+code);
                 return new BasicStroke(w);
             }
Index: /trunk/src/org/openstreetmap/josm/gui/widgets/AbstractIdTextField.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/widgets/AbstractIdTextField.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/widgets/AbstractIdTextField.java	(revision 6248)
@@ -4,5 +4,5 @@
 import javax.swing.text.JTextComponent;
 
-import org.openstreetmap.josm.gui.widgets.JosmTextField;
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -39,5 +39,5 @@
             }
         } catch (Exception e) {
-            System.err.println(e.getClass().getName()+": "+e.getMessage());
+            Main.error(e);
         } finally {
             this.validator = validator;
Index: /trunk/src/org/openstreetmap/josm/gui/widgets/JosmPasswordField.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/widgets/JosmPasswordField.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/gui/widgets/JosmPasswordField.java	(revision 6248)
@@ -10,4 +10,6 @@
 import javax.swing.text.Document;
 import javax.swing.text.JTextComponent;
+
+import org.openstreetmap.josm.Main;
 
 /**
@@ -103,5 +105,5 @@
                         pasteAction.actionPerformed(e);
                     } catch (NullPointerException npe) {
-                        System.err.println("NullPointerException occured because of JDK bug 6322854. "
+                        Main.error("NullPointerException occured because of JDK bug 6322854. "
                                 +"Copy/Paste operation has not been performed. Please complain to Oracle: "+
                                 "http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6322854");
Index: /trunk/src/org/openstreetmap/josm/io/AbstractReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/AbstractReader.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/AbstractReader.java	(revision 6248)
@@ -10,4 +10,5 @@
 import java.util.Map;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.Changeset;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -101,5 +102,5 @@
                 }
                 if (n.isDeleted()) {
-                    System.out.println(tr("Deleted node {0} is part of way {1}", id, w.getId()));
+                    Main.info(tr("Deleted node {0} is part of way {1}", id, w.getId()));
                 } else {
                     wayNodes.add(n);
@@ -108,5 +109,5 @@
             w.setNodes(wayNodes);
             if (w.hasIncompleteNodes()) {
-                  System.out.println(tr("Way {0} with {1} nodes has incomplete nodes because at least one node was missing in the loaded data.",
+                Main.info(tr("Way {0} with {1} nodes has incomplete nodes because at least one node was missing in the loaded data.",
                           externalWayId, w.getNodesCount()));
             }
@@ -174,5 +175,5 @@
                 }
                 if (primitive.isDeleted()) {
-                    System.out.println(tr("Deleted member {0} is used by relation {1}", primitive.getId(), relation.getId()));
+                    Main.info(tr("Deleted member {0} is used by relation {1}", primitive.getId(), relation.getId()));
                 } else {
                     relationMembers.add(new RelationMember(rm.getRole(), primitive));
Index: /trunk/src/org/openstreetmap/josm/io/CacheFiles.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/CacheFiles.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/CacheFiles.java	(revision 6248)
@@ -14,4 +14,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -115,6 +116,6 @@
             new RandomAccessFile(data, "r").readFully(bytes);
             return bytes;
-        } catch(Exception e) {
-            System.out.println(e.getMessage());
+        } catch (Exception e) {
+            Main.warn(e);
         }
         return null;
@@ -130,11 +131,16 @@
         try {
             File f = getPath(ident);
-            if(f.exists()) {
+            if (f.exists()) {
                 f.delete();
             }
             // rws also updates the file meta-data, i.e. last mod time
-            new RandomAccessFile(f, "rws").write(data);
-        } catch(Exception e){
-            System.out.println(e.getMessage());
+            RandomAccessFile raf = new RandomAccessFile(f, "rws");
+            try {
+                raf.write(data);
+            } finally {
+                Utils.close(raf);
+            }
+        } catch (Exception e) {
+            Main.warn(e);
         }
 
@@ -164,6 +170,6 @@
             }
             return ImageIO.read(img);
-        } catch(Exception e) {
-            System.out.println(e.getMessage());
+        } catch (Exception e) {
+            Main.warn(e);
         }
         return null;
@@ -176,9 +182,9 @@
      */
     public void saveImg(String ident, BufferedImage image) {
-        if(!enabled) return;
+        if (!enabled) return;
         try {
             ImageIO.write(image, "png", getPath(ident, "png"));
-        } catch(Exception e){
-            System.out.println(e.getMessage());
+        } catch (Exception e) {
+            Main.warn(e);
         }
 
Index: /trunk/src/org/openstreetmap/josm/io/Capabilities.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/Capabilities.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/Capabilities.java	(revision 6248)
@@ -8,4 +8,6 @@
 import java.util.HashMap;
 import java.util.List;
+
+import org.openstreetmap.josm.Main;
 
 /**
@@ -120,10 +122,10 @@
             int n = Integer.parseInt(v);
             if (n <= 0) {
-                System.err.println(tr("Warning: illegal value of attribute ''{0}'' of element ''{1}'' in server capabilities. Got ''{2}''", "changesets", "maximum_elements", n ));
+                Main.warn(tr("Illegal value of attribute ''{0}'' of element ''{1}'' in server capabilities. Got ''{2}''", "changesets", "maximum_elements", n ));
                 return -1;
             }
             return n;
-        } catch(NumberFormatException e) {
-            System.err.println(tr("Warning: illegal value of attribute ''{0}'' of element ''{1}'' in server capabilities. Got ''{2}''", "changesets", "maximum_elements", v ));
+        } catch (NumberFormatException e) {
+            Main.warn(tr("Illegal value of attribute ''{0}'' of element ''{1}'' in server capabilities. Got ''{2}''", "changesets", "maximum_elements", v ));
             return -1;
         }
Index: /trunk/src/org/openstreetmap/josm/io/ChangesetClosedException.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/ChangesetClosedException.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/ChangesetClosedException.java	(revision 6248)
@@ -11,4 +11,6 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+
+import org.openstreetmap.josm.Main;
 
 /**
@@ -81,9 +83,9 @@
                 closedOn = formatter.parse(m.group(2));
             } catch(ParseException ex) {
-                System.err.println(tr("Failed to parse date ''{0}'' replied by server.", m.group(2)));
+                Main.error(tr("Failed to parse date ''{0}'' replied by server.", m.group(2)));
                 ex.printStackTrace();
             }
         } else {
-            System.err.println(tr("Unexpected format of error header for conflict in changeset update. Got ''{0}''", errorHeader));
+            Main.error(tr("Unexpected format of error header for conflict in changeset update. Got ''{0}''", errorHeader));
         }
     }
Index: /trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java	(revision 6248)
@@ -7,8 +7,8 @@
 import java.net.InetSocketAddress;
 import java.net.Proxy;
+import java.net.Proxy.Type;
 import java.net.ProxySelector;
 import java.net.SocketAddress;
 import java.net.URI;
-import java.net.Proxy.Type;
 import java.util.Collections;
 import java.util.List;
@@ -79,11 +79,11 @@
             port = Integer.parseInt(value);
         } catch (NumberFormatException e) {
-            System.err.println(tr("Unexpected format for port number in in preference ''{0}''. Got ''{1}''.", property, value));
-            System.err.println(tr("The proxy will not be used."));
+            Main.error(tr("Unexpected format for port number in in preference ''{0}''. Got ''{1}''.", property, value));
+            Main.error(tr("The proxy will not be used."));
             return 0;
         }
         if (port <= 0 || port >  65535) {
-            System.err.println(tr("Illegal port number in preference ''{0}''. Got {1}.", property, port));
-            System.err.println(tr("The proxy will not be used."));
+            Main.error(tr("Illegal port number in preference ''{0}''. Got {1}.", property, port));
+            Main.error(tr("The proxy will not be used."));
             return 0;
         }
@@ -102,5 +102,5 @@
             proxyPolicy= ProxyPolicy.fromName(value);
             if (proxyPolicy == null) {
-                System.err.println(tr("Warning: unexpected value for preference ''{0}'' found. Got ''{1}''. Will use no proxy.", ProxyPreferencesPanel.PROXY_POLICY, value));
+                Main.warn(tr("Unexpected value for preference ''{0}'' found. Got ''{1}''. Will use no proxy.", ProxyPreferencesPanel.PROXY_POLICY, value));
                 proxyPolicy = ProxyPolicy.NO_PROXY;
             }
@@ -113,6 +113,6 @@
             httpProxySocketAddress = null;
             if (proxyPolicy.equals(ProxyPolicy.USE_HTTP_PROXY)) {
-                System.err.println(tr("Warning: Unexpected parameters for HTTP proxy. Got host ''{0}'' and port ''{1}''.", host, port));
-                System.err.println(tr("The proxy will not be used."));
+                Main.warn(tr("Unexpected parameters for HTTP proxy. Got host ''{0}'' and port ''{1}''.", host, port));
+                Main.warn(tr("The proxy will not be used."));
             }
         }
@@ -125,6 +125,6 @@
             socksProxySocketAddress = null;
             if (proxyPolicy.equals(ProxyPolicy.USE_SOCKS_PROXY)) {
-                System.err.println(tr("Warning: Unexpected parameters for SOCKS proxy. Got host ''{0}'' and port ''{1}''.", host, port));
-                System.err.println(tr("The proxy will not be used."));
+                Main.warn(tr("Unexpected parameters for SOCKS proxy. Got host ''{0}'' and port ''{1}''.", host, port));
+                Main.warn(tr("The proxy will not be used."));
             }
         }
@@ -133,8 +133,7 @@
     @Override
     public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {
-        // Just log something. The network stack will also throw an exception which will be caught
-        // somewhere else
+        // Just log something. The network stack will also throw an exception which will be caught somewhere else
         //
-        System.out.println(tr("Error: Connection to proxy ''{0}'' for URI ''{1}'' failed. Exception was: {2}", sa.toString(), uri.toString(), ioe.toString()));
+        Main.error(tr("Connection to proxy ''{0}'' for URI ''{1}'' failed. Exception was: {2}", sa.toString(), uri.toString(), ioe.toString()));
     }
 
@@ -145,5 +144,5 @@
         case USE_SYSTEM_SETTINGS:
             if (!JVM_WILL_USE_SYSTEM_PROXIES) {
-                System.err.println(tr("Warning: the JVM is not configured to lookup proxies from the system settings. The property ''java.net.useSystemProxies'' was missing at startup time.  Will not use a proxy."));
+                Main.warn(tr("The JVM is not configured to lookup proxies from the system settings. The property ''java.net.useSystemProxies'' was missing at startup time.  Will not use a proxy."));
                 return Collections.singletonList(Proxy.NO_PROXY);
             }
Index: /trunk/src/org/openstreetmap/josm/io/FileImporter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/FileImporter.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/FileImporter.java	(revision 6248)
@@ -63,5 +63,5 @@
     public boolean importDataHandleExceptions(File f, ProgressMonitor progressMonitor) {
         try {
-            System.out.println("Open file: " + f.getAbsolutePath() + " (" + f.length() + " bytes)");
+            Main.info("Open file: " + f.getAbsolutePath() + " (" + f.length() + " bytes)");
             importData(f, progressMonitor);
             return true;
@@ -79,5 +79,5 @@
     public boolean importDataHandleExceptions(List<File> files, ProgressMonitor progressMonitor) {
         try {
-            System.out.println("Open "+files.size()+" files");
+            Main.info("Open "+files.size()+" files");
             importData(files, progressMonitor);
             return true;
Index: /trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java	(revision 6248)
@@ -150,6 +150,6 @@
             }
         } catch (Exception e) {
-            if(file.getName().endsWith(".zip")) {
-                System.err.println(tr("Warning: failed to open file with extension ''{2}'' and namepart ''{3}'' in zip file ''{0}''. Exception was: {1}",
+            if (file.getName().endsWith(".zip")) {
+                Main.warn(tr("Failed to open file with extension ''{2}'' and namepart ''{3}'' in zip file ''{0}''. Exception was: {1}",
                         file.getName(), e.toString(), extension, namepart));
             }
@@ -257,11 +257,10 @@
                 {Long.toString(System.currentTimeMillis()), localFile.toString()}));
             } else {
-                System.out.println(tr("Failed to rename file {0} to {1}.",
+                Main.warn(tr("Failed to rename file {0} to {1}.",
                 destDirFile.getPath(), localFile.getPath()));
             }
         } catch (IOException e) {
             if (age >= maxTime*1000 && age < maxTime*1000*2) {
-                System.out.println(tr("Failed to load {0}, use cached file and retry next time: {1}",
-                url, e));
+                Main.warn(tr("Failed to load {0}, use cached file and retry next time: {1}", url, e));
                 return localFile;
             } else {
@@ -319,5 +318,5 @@
                     throw new IOException(msg);
                 }
-                System.out.println(tr("Download redirected to ''{0}''", downloadUrl));
+                Main.info(tr("Download redirected to ''{0}''", downloadUrl));
                 break;
             default:
Index: /trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java	(revision 6248)
@@ -49,8 +49,8 @@
  *    reader.parseOsm();
  *    if (!reader.getMissingPrimitives().isEmpty()) {
- *        System.out.println("There are missing primitives: " + reader.getMissingPrimitives());
+ *        Main.info("There are missing primitives: " + reader.getMissingPrimitives());
  *    }
  *    if (!reader.getSkippedWays().isEmpty()) {
- *       System.out.println("There are skipped ways: " + reader.getMissingPrimitives());
+ *       Main.info("There are skipped ways: " + reader.getMissingPrimitives());
  *    }
  * </pre>
@@ -489,5 +489,5 @@
             } catch (OsmApiException e) {
                 if (e.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
-                    System.out.println(tr("Server replied with response code 404, retrying with an individual request for each object."));
+                    Main.info(tr("Server replied with response code 404, retrying with an individual request for each object."));
                     return singleGetIdPackage(type, pkg, progressMonitor);
                 } else {
@@ -567,5 +567,5 @@
                 } catch (OsmApiException e) {
                     if (e.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
-                        System.out.println(tr("Server replied with response code 404 for id {0}. Skipping.", Long.toString(id)));
+                        Main.info(tr("Server replied with response code 404 for id {0}. Skipping.", Long.toString(id)));
                         result.missingPrimitives.add(new SimplePrimitiveId(id, type));
                     } else {
Index: /trunk/src/org/openstreetmap/josm/io/NmeaReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/NmeaReader.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/NmeaReader.java	(revision 6248)
@@ -247,9 +247,8 @@
                 byte[] chb = chkstrings[0].getBytes();
                 int chk=0;
-                for(int i = 1; i < chb.length; i++) {
+                for (int i = 1; i < chb.length; i++) {
                     chk ^= chb[i];
                 }
-                if(Integer.parseInt(chkstrings[1].substring(0,2),16) != chk) {
-                    //System.out.println("Checksum error");
+                if (Integer.parseInt(chkstrings[1].substring(0,2),16) != chk) {
                     ps.checksum_errors++;
                     ps.p_Wp=null;
@@ -447,8 +446,6 @@
             return true;
 
-        } catch(RuntimeException x) {
+        } catch (RuntimeException x) {
             // out of bounds and such
-            // x.printStackTrace();
-            // System.out.println("Malformed line: "+s.toString().trim());
             ps.malformed++;
             ps.p_Wp=null;
Index: /trunk/src/org/openstreetmap/josm/io/OsmApi.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmApi.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/OsmApi.java	(revision 6248)
@@ -229,6 +229,6 @@
                 version = "0.6";
             } else {
-                System.err.println(tr("This version of JOSM is incompatible with the configured server."));
-                System.err.println(tr("It supports protocol version 0.6, while the server says it supports {0} to {1}.",
+                Main.error(tr("This version of JOSM is incompatible with the configured server."));
+                Main.error(tr("It supports protocol version 0.6, while the server says it supports {0} to {1}.",
                         capabilities.get("version", "minimum"), capabilities.get("version", "maximum")));
                 initialized = false; // FIXME gets overridden by next assignment
@@ -256,5 +256,5 @@
                 for (Layer l : Main.map.mapView.getLayersOfType(ImageryLayer.class)) {
                     if (((ImageryLayer) l).getInfo().isBlacklisted()) {
-                        System.out.println(tr("Removed layer {0} because it is not allowed by the configured API.", l.getName()));
+                        Main.info(tr("Removed layer {0} because it is not allowed by the configured API.", l.getName()));
                         Main.main.removeLayer(l);
                     }
@@ -548,5 +548,5 @@
             } catch (InterruptedException ex) {}
         }
-        System.out.println(tr("OK - trying again."));
+        Main.info(tr("OK - trying again."));
     }
 
@@ -628,5 +628,5 @@
 
                 activeConnection.connect();
-                System.out.println(activeConnection.getResponseMessage());
+                Main.info(activeConnection.getResponseMessage());
                 int retCode = activeConnection.getResponseCode();
 
@@ -634,5 +634,5 @@
                     if (retries-- > 0) {
                         sleepAndListen(retries, monitor);
-                        System.out.println(tr("Starting retry {0} of {1}.", getMaxRetries() - retries,getMaxRetries()));
+                        Main.info(tr("Starting retry {0} of {1}.", getMaxRetries() - retries,getMaxRetries()));
                         continue;
                     }
@@ -666,7 +666,7 @@
                 if (activeConnection.getHeaderField("Error") != null) {
                     errorHeader = activeConnection.getHeaderField("Error");
-                    System.err.println("Error header: " + errorHeader);
+                    Main.error("Error header: " + errorHeader);
                 } else if (retCode != 200 && responseBody.length()>0) {
-                    System.err.println("Error body: " + responseBody);
+                    Main.error("Error body: " + responseBody);
                 }
                 activeConnection.disconnect();
Index: /trunk/src/org/openstreetmap/josm/io/OsmChangesetContentParser.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmChangesetContentParser.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/OsmChangesetContentParser.java	(revision 6248)
@@ -13,4 +13,5 @@
 import javax.xml.parsers.SAXParserFactory;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.ChangesetDataSet;
 import org.openstreetmap.josm.data.osm.ChangesetDataSet.ChangesetModificationType;
@@ -57,5 +58,5 @@
                 currentModificationType = ChangesetModificationType.DELETED;
             } else {
-                System.err.println(tr("Warning: unsupported start element ''{0}'' in changeset content at position ({1},{2}). Skipping.", qName, locator.getLineNumber(), locator.getColumnNumber()));
+                Main.warn(tr("Unsupported start element ''{0}'' in changeset content at position ({1},{2}). Skipping.", qName, locator.getLineNumber(), locator.getColumnNumber()));
             }
         }
@@ -85,5 +86,5 @@
                 // do nothing
             } else {
-                System.err.println(tr("Warning: unsupported end element ''{0}'' in changeset content at position ({1},{2}). Skipping.", qName, locator.getLineNumber(), locator.getColumnNumber()));
+                Main.warn(tr("Unsupported end element ''{0}'' in changeset content at position ({1},{2}). Skipping.", qName, locator.getLineNumber(), locator.getColumnNumber()));
             }
         }
Index: /trunk/src/org/openstreetmap/josm/io/OsmConnection.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmConnection.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/OsmConnection.java	(revision 6248)
@@ -4,6 +4,6 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
+import java.net.Authenticator.RequestorType;
 import java.net.HttpURLConnection;
-import java.net.Authenticator.RequestorType;
 import java.nio.ByteBuffer;
 import java.nio.CharBuffer;
@@ -19,6 +19,6 @@
 import org.openstreetmap.josm.gui.preferences.server.OAuthAccessTokenHolder;
 import org.openstreetmap.josm.io.auth.CredentialsAgentException;
+import org.openstreetmap.josm.io.auth.CredentialsAgentResponse;
 import org.openstreetmap.josm.io.auth.CredentialsManager;
-import org.openstreetmap.josm.io.auth.CredentialsAgentResponse;
 import org.openstreetmap.josm.tools.Base64;
 
@@ -132,6 +132,6 @@
             addOAuthAuthorizationHeader(connection);
         } else {
-            String msg = tr("Warning: unexpected value for preference ''{0}''. Got ''{1}''.", "osm-server.auth-method", authMethod);
-            System.err.println(msg);
+            String msg = tr("Unexpected value for preference ''{0}''. Got ''{1}''.", "osm-server.auth-method", authMethod);
+            Main.warn(msg);
             throw new OsmTransferException(msg);
         }
Index: /trunk/src/org/openstreetmap/josm/io/OsmReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmReader.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/OsmReader.java	(revision 6248)
@@ -18,4 +18,5 @@
 import javax.xml.stream.XMLStreamReader;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -171,5 +172,5 @@
                 Bounds copy = new Bounds(bounds);
                 bounds.normalize();
-                System.out.println("Bbox " + copy + " is out of the world, normalized to " + bounds);
+                Main.info("Bbox " + copy + " is out of the world, normalized to " + bounds);
             }
             DataSource src = new DataSource(bounds, origin);
@@ -233,5 +234,5 @@
         }
         if (w.isDeleted() && !nodeIds.isEmpty()) {
-            System.out.println(tr("Deleted way {0} contains nodes", w.getUniqueId()));
+            Main.info(tr("Deleted way {0} contains nodes", w.getUniqueId()));
             nodeIds = new ArrayList<Long>();
         }
@@ -280,5 +281,5 @@
         }
         if (r.isDeleted() && !members.isEmpty()) {
-            System.out.println(tr("Deleted relation {0} contains members", r.getUniqueId()));
+            Main.info(tr("Deleted relation {0} contains members", r.getUniqueId()));
             members = new ArrayList<RelationMemberData>();
         }
@@ -356,5 +357,5 @@
     protected void parseUnknown(boolean printWarning) throws XMLStreamException {
         if (printWarning) {
-            System.out.println(tr("Undefined element ''{0}'' found in input stream. Skipping.", parser.getLocalName()));
+            Main.info(tr("Undefined element ''{0}'' found in input stream. Skipping.", parser.getLocalName()));
         }
         while (true) {
@@ -445,13 +446,13 @@
                     throwException(tr("Illegal value for attribute ''version'' on OSM primitive with ID {0}. Got {1}.", Long.toString(current.getUniqueId()), versionString));
                 } else if (version < 0 && current.getUniqueId() <= 0) {
-                    System.out.println(tr("WARNING: Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.getUniqueId(), version, 0, "0.6"));
+                    Main.warn(tr("Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.getUniqueId(), version, 0, "0.6"));
                     version = 0;
                 }
             } else if (ds.getVersion().equals("0.5")) {
                 if (version <= 0 && current.getUniqueId() > 0) {
-                    System.out.println(tr("WARNING: Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.getUniqueId(), version, 1, "0.5"));
+                    Main.warn(tr("Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.getUniqueId(), version, 1, "0.5"));
                     version = 1;
                 } else if (version < 0 && current.getUniqueId() <= 0) {
-                    System.out.println(tr("WARNING: Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.getUniqueId(), version, 0, "0.5"));
+                    Main.warn(tr("Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.getUniqueId(), version, 0, "0.5"));
                     version = 0;
                 }
@@ -467,5 +468,5 @@
             } else if (current.getUniqueId() > 0 && ds.getVersion() != null && ds.getVersion().equals("0.5")) {
                 // default version in 0.5 files for existing primitives
-                System.out.println(tr("WARNING: Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.getUniqueId(), version, 1, "0.5"));
+                Main.warn(tr("Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.getUniqueId(), version, 1, "0.5"));
                 version= 1;
             } else if (current.getUniqueId() <= 0 && ds.getVersion() != null && ds.getVersion().equals("0.5")) {
@@ -496,5 +497,5 @@
                 if (current.getUniqueId() <= 0) {
                     // for a new primitive we just log a warning
-                    System.out.println(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.", v, current.getUniqueId()));
+                    Main.info(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.", v, current.getUniqueId()));
                     current.setChangesetId(0);
                 } else {
@@ -506,5 +507,5 @@
                 if (current.getUniqueId() <= 0) {
                     // for a new primitive we just log a warning
-                    System.out.println(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.", v, current.getUniqueId()));
+                    Main.info(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.", v, current.getUniqueId()));
                     current.setChangesetId(0);
                 } else {
Index: /trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmServerReader.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/OsmServerReader.java	(revision 6248)
@@ -107,5 +107,5 @@
 
             try {
-                System.out.println("GET " + url);
+                Main.info("GET " + url);
                 activeConnection.connect();
             } catch (Exception e) {
Index: /trunk/src/org/openstreetmap/josm/io/imagery/HTMLGrabber.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/imagery/HTMLGrabber.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/imagery/HTMLGrabber.java	(revision 6248)
@@ -30,9 +30,9 @@
         String urlstring = url.toExternalForm();
 
-        System.out.println("Grabbing HTML " + (attempt > 1? "(attempt " + attempt + ") ":"") + url);
+        Main.info("Grabbing HTML " + (attempt > 1? "(attempt " + attempt + ") ":"") + url);
 
         ArrayList<String> cmdParams = new ArrayList<String>();
         StringTokenizer st = new StringTokenizer(MessageFormat.format(PROP_BROWSER.get(), urlstring));
-        while( st.hasMoreTokens() ) {
+        while (st.hasMoreTokens()) {
             cmdParams.add(st.nextToken());
         }
@@ -43,5 +43,5 @@
         try {
             browser = builder.start();
-        } catch(IOException ioe) {
+        } catch (IOException ioe) {
             throw new IOException( "Could not start browser. Please check that the executable path is correct.\n" + ioe.getMessage() );
         }
Index: /trunk/src/org/openstreetmap/josm/io/imagery/WMSGrabber.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/imagery/WMSGrabber.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/imagery/WMSGrabber.java	(revision 6248)
@@ -158,5 +158,5 @@
 
     protected BufferedImage grab(WMSRequest request, URL url, int attempt) throws IOException, OsmTransferException {
-        System.out.println("Grabbing WMS " + (attempt > 1? "(attempt " + attempt + ") ":"") + url);
+        Main.info("Grabbing WMS " + (attempt > 1? "(attempt " + attempt + ") ":"") + url);
 
         HttpURLConnection conn = Utils.openHttpConnection(url);
Index: /trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java	(revision 6248)
@@ -20,4 +20,5 @@
 import javax.xml.parsers.DocumentBuilderFactory;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
@@ -127,5 +128,5 @@
         }
 
-        System.out.println("GET " + getCapabilitiesUrl.toString());
+        Main.info("GET " + getCapabilitiesUrl.toString());
         URLConnection openConnection = Utils.openHttpConnection(getCapabilitiesUrl);
         InputStream inputStream = openConnection.getInputStream();
@@ -139,5 +140,4 @@
         String incomingData = ba.toString();
 
-        //System.out.println("WMS capabilities:\n"+incomingData+"\n");
         try {
             DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
@@ -149,5 +149,5 @@
                 @Override
                 public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
-                    System.out.println("Ignoring DTD " + publicId + ", " + systemId);
+                    Main.info("Ignoring DTD " + publicId + ", " + systemId);
                     return new InputSource(new StringReader(""));
                 }
@@ -175,5 +175,5 @@
                 String baseURL = child.getAttribute("xlink:href");
                 if (baseURL != null && !baseURL.equals(serviceUrlStr)) {
-                    System.out.println("GetCapabilities specifies a different service URL: " + baseURL);
+                    Main.info("GetCapabilities specifies a different service URL: " + baseURL);
                     serviceUrl = new URL(baseURL);
                 }
Index: /trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java	(revision 6248)
@@ -6,8 +6,8 @@
 import java.io.IOException;
 import java.net.BindException;
+import java.net.InetAddress;
 import java.net.ServerSocket;
 import java.net.Socket;
 import java.net.SocketException;
-import java.net.InetAddress;
 
 import org.openstreetmap.josm.Main;
@@ -37,5 +37,5 @@
             instance.start();
         } catch (BindException ex) {
-            Main.warn(marktr("Warning: Cannot start remotecontrol server on port {0}: {1}"),
+            Main.warn(marktr("Cannot start remotecontrol server on port {0}: {1}"),
                     Integer.toString(port), ex.getLocalizedMessage());
         } catch (IOException ioe) {
Index: /trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java	(revision 6248)
@@ -22,4 +22,5 @@
 import java.util.regex.Pattern;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.help.HelpUtil;
 import org.openstreetmap.josm.io.remotecontrol.handler.AddNodeHandler;
@@ -110,9 +111,9 @@
         String commandWithSlash = "/" + command;
         if (handlers.get(commandWithSlash) != null) {
-            System.out.println("RemoteControl: ignoring duplicate command " + command
+            Main.info("RemoteControl: ignoring duplicate command " + command
                     + " with handler " + handler.getName());
         } else {
             if (!silent) {
-                System.out.println("RemoteControl: adding command \"" +
+                Main.info("RemoteControl: adding command \"" +
                     command + "\" (handled by " + handler.getSimpleName() + ")");
             }
@@ -151,5 +152,5 @@
                 return;
             }
-            System.out.println("RemoteControl received: " + get);
+            Main.info("RemoteControl received: " + get);
 
             StringTokenizer st = new StringTokenizer(get);
Index: /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandler.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandler.java	(revision 6248)
@@ -6,4 +6,5 @@
 import java.awt.Point;
 import java.util.HashMap;
+
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.AutoScaleAction;
@@ -15,5 +16,4 @@
 import org.openstreetmap.josm.io.remotecontrol.AddTagsDialog;
 import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;
-import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
 
 /**
@@ -77,5 +77,5 @@
 
         // Parse the arguments
-        System.out.println("Adding node at (" + lat + ", " + lon + ")");
+        Main.info("Adding node at (" + lat + ", " + lon + ")");
 
         // Create a new node
Index: /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandler.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandler.java	(revision 6248)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.io.remotecontrol.handler;
 
-import java.util.Arrays;
 import static org.openstreetmap.josm.tools.I18n.tr;
 
+import java.util.Arrays;
 import java.util.HashMap;
 
@@ -61,5 +61,5 @@
                 imgInfo.setDefaultMinZoom(Integer.parseInt(min_zoom));
             } catch (NumberFormatException e) {
-                System.err.println("NumberFormatException ("+e.getMessage()+")");
+                Main.error(e);
             }
         }
@@ -69,5 +69,5 @@
                 imgInfo.setDefaultMaxZoom(Integer.parseInt(max_zoom));
             } catch (NumberFormatException e) {
-                System.err.println("NumberFormatException ("+e.getMessage()+")");
+                Main.error(e);
             }
         }
Index: /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java	(revision 6248)
@@ -35,5 +35,5 @@
             }
         } catch (Exception ex) {
-            System.out.println("RemoteControl: Error parsing import remote control request:");
+            Main.warn("RemoteControl: Error parsing import remote control request:");
             ex.printStackTrace();
             throw new RequestHandlerErrorException();
Index: /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java	(revision 6248)
@@ -97,12 +97,8 @@
             boolean newLayer = isLoadInNewLayer();
 
-            if(command.equals(myCommand))
-            {
-                if (!PermissionPrefWithDefault.LOAD_DATA.isAllowed())
-                {
-                    System.out.println("RemoteControl: download forbidden by preferences");
-                }
-                else
-                {
+            if (command.equals(myCommand)) {
+                if (!PermissionPrefWithDefault.LOAD_DATA.isAllowed()) {
+                    Main.info("RemoteControl: download forbidden by preferences");
+                } else {
                     Area toDownload = null;
                     if (!newLayer) {
@@ -116,6 +112,5 @@
                             toDownload = new Area(new Rectangle2D.Double(minlon,minlat,maxlon-minlon,maxlat-minlat));
                             toDownload.subtract(present);
-                            if (!toDownload.isEmpty())
-                            {
+                            if (!toDownload.isEmpty()) {
                                 // the result might not be a rectangle (L shaped etc)
                                 Rectangle2D downloadBounds = toDownload.getBounds2D();
@@ -127,10 +122,7 @@
                         }
                     }
-                    if (toDownload != null && toDownload.isEmpty())
-                    {
-                        System.out.println("RemoteControl: no download necessary");
-                    }
-                    else
-                    {
+                    if (toDownload != null && toDownload.isEmpty()) {
+                        Main.info("RemoteControl: no download necessary");
+                    } else {
                         Future<?> future = osmTask.download(newLayer, new Bounds(minlat,minlon,maxlat,maxlon), null /* let the task manage the progress monitor */);
                         Main.worker.submit(new PostDownloadHandler(osmTask, future));
@@ -139,5 +131,5 @@
             }
         } catch (Exception ex) {
-            System.out.println("RemoteControl: Error parsing load_and_zoom remote control request:");
+            Main.warn("RemoteControl: Error parsing load_and_zoom remote control request:");
             ex.printStackTrace();
             throw new RequestHandlerErrorException();
@@ -262,8 +254,8 @@
                         relations.add(Long.parseLong(item.substring(3)));
                     } else {
-                        System.out.println("RemoteControl: invalid selection '"+item+"' ignored");
+                        Main.warn("RemoteControl: invalid selection '"+item+"' ignored");
                     }
                 } catch (NumberFormatException e) {
-                    System.out.println("RemoteControl: invalid selection '"+item+"' ignored");
+                    Main.warn("RemoteControl: invalid selection '"+item+"' ignored");
                 }
             }
Index: /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandler.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandler.java	(revision 6248)
@@ -50,5 +50,5 @@
     protected void handleRequest() throws RequestHandlerErrorException, RequestHandlerBadRequestException {
         if (!PermissionPrefWithDefault.LOAD_DATA.isAllowed()) {
-            System.out.println("RemoteControl: download forbidden by preferences");
+            Main.info("RemoteControl: download forbidden by preferences");
         }
         if (!ps.isEmpty()) {
@@ -88,5 +88,5 @@
                 ps.add(SimplePrimitiveId.fromString(i));
             } catch (IllegalArgumentException e) {
-                System.out.println("RemoteControl: invalid selection '"+i+"' ignored");
+                Main.warn("RemoteControl: invalid selection '"+i+"' ignored");
             }
         }
Index: /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java	(revision 6248)
@@ -137,5 +137,5 @@
             if (!Main.pref.getBoolean(permissionPref.pref, permissionPref.defaultVal)) {
                 String err = MessageFormat.format("RemoteControl: ''{0}'' forbidden by preferences", myCommand);
-                System.out.println(err);
+                Main.info(err);
                 throw new RequestHandlerForbiddenException(err);
             }
@@ -211,5 +211,5 @@
             if ((value == null) || (value.length() == 0)) {
                 error = true;
-                System.out.println("'" + myCommand + "' remote control request must have '" + key + "' parameter");
+                Main.warn("'" + myCommand + "' remote control request must have '" + key + "' parameter");
                 missingKeys.add(key);
             }
Index: /trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java	(revision 6248)
@@ -114,6 +114,6 @@
         try {
             if (pi.downloadlink == null) {
-                String msg = tr("Warning: Cannot download plugin ''{0}''. Its download link is not known. Skipping download.", pi.name);
-                System.err.println(msg);
+                String msg = tr("Cannot download plugin ''{0}''. Its download link is not known. Skipping download.", pi.name);
+                Main.warn(msg);
                 throw new PluginDownloadException(msg);
             }
@@ -128,7 +128,7 @@
                 out.write(buffer, 0, read);
             }
-        } catch(MalformedURLException e) {
-            String msg = tr("Warning: Cannot download plugin ''{0}''. Its download link ''{1}'' is not a valid URL. Skipping download.", pi.name, pi.downloadlink);
-            System.err.println(msg);
+        } catch (MalformedURLException e) {
+            String msg = tr("Cannot download plugin ''{0}''. Its download link ''{1}'' is not a valid URL. Skipping download.", pi.name, pi.downloadlink);
+            Main.warn(msg);
             throw new PluginDownloadException(msg);
         } catch (IOException e) {
Index: /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 6248)
@@ -66,10 +66,10 @@
  * PluginHandler is basically a collection of static utility functions used to bootstrap
  * and manage the loaded plugins.
- *
+ * @since 1326
  */
 public class PluginHandler {
 
     /**
-     * deprecated plugins that are removed on start
+     * Deprecated plugins that are removed on start
      */
     public final static Collection<DeprecatedPlugin> DEPRECATED_PLUGINS;
@@ -117,20 +117,38 @@
     }
 
+    /**
+     * Description of a deprecated plugin
+     */
     public static class DeprecatedPlugin implements Comparable<DeprecatedPlugin> {
-        public String name;
-        // short explanation, can be null
-        public String reason;
-        // migration, can be null
-        private Runnable migration;
-
+        /** Plugin name */
+        public final String name;
+        /** Short explanation about deprecation, can be {@code null} */
+        public final String reason;
+        /** Code to run to perform migration, can be {@code null} */
+        private final Runnable migration;
+
+        /**
+         * Constructs a new {@code DeprecatedPlugin}.
+         * @param name The plugin name
+         */
         public DeprecatedPlugin(String name) {
-            this.name = name;
-        }
-
+            this(name, null, null);
+        }
+
+        /**
+         * Constructs a new {@code DeprecatedPlugin} with a given reason.
+         * @param name The plugin name
+         * @param reason The reason about deprecation
+         */
         public DeprecatedPlugin(String name, String reason) {
-            this.name = name;
-            this.reason = reason;
-        }
-
+            this(name, reason, null);
+        }
+
+        /**
+         * Constructs a new {@code DeprecatedPlugin}.
+         * @param name The plugin name
+         * @param reason The reason about deprecation
+         * @param migration The code to run to perform migration
+         */
         public DeprecatedPlugin(String name, String reason, Runnable migration) {
             this.name = name;
@@ -139,4 +157,7 @@
         }
 
+        /**
+         * Performs migration.
+         */
         public void migrate() {
             if (migration != null) {
@@ -151,4 +172,7 @@
     }
 
+    /**
+     * List of unmaintained plugins. Not really up-to-date as the vast majority of plugins are not really maintained after a few months, sadly...
+     */
     final public static String [] UNMAINTAINED_PLUGINS = new String[] {"gpsbabelgui", "Intersect_way"};
 
@@ -319,7 +343,7 @@
         if (policy.equals("never")) {
             if ("pluginmanager.version-based-update.policy".equals(togglePreferenceKey)) {
-                System.out.println(tr("Skipping plugin update after JOSM upgrade. Automatic update at startup is disabled."));
+                Main.info(tr("Skipping plugin update after JOSM upgrade. Automatic update at startup is disabled."));
             } else if ("pluginmanager.time-based-update.policy".equals(togglePreferenceKey)) {
-                System.out.println(tr("Skipping plugin update after elapsed update interval. Automatic update at startup is disabled."));
+                Main.info(tr("Skipping plugin update after elapsed update interval. Automatic update at startup is disabled."));
             }
             return false;
@@ -328,7 +352,7 @@
         if (policy.equals("always")) {
             if ("pluginmanager.version-based-update.policy".equals(togglePreferenceKey)) {
-                System.out.println(tr("Running plugin update after JOSM upgrade. Automatic update at startup is enabled."));
+                Main.info(tr("Running plugin update after JOSM upgrade. Automatic update at startup is enabled."));
             } else if ("pluginmanager.time-based-update.policy".equals(togglePreferenceKey)) {
-                System.out.println(tr("Running plugin update after elapsed update interval. Automatic update at startup is disabled."));
+                Main.info(tr("Running plugin update after elapsed update interval. Automatic update at startup is disabled."));
             }
             return true;
@@ -336,5 +360,5 @@
 
         if (!policy.equals("ask")) {
-            System.err.println(tr("Unexpected value ''{0}'' for preference ''{1}''. Assuming value ''ask''.", policy, togglePreferenceKey));
+            Main.warn(tr("Unexpected value ''{0}'' for preference ''{1}''. Assuming value ''ask''.", policy, togglePreferenceKey));
         }
         int ret = HelpAwareOptionPane.showOptionDialog(
@@ -513,4 +537,5 @@
      * the class loader <code>pluginClassLoader</code>.
      *
+     * @param parent The parent component to be used for the displayed dialog
      * @param plugin the plugin
      * @param pluginClassLoader the plugin class loader
@@ -521,5 +546,5 @@
             Class<?> klass = plugin.loadClass(pluginClassLoader);
             if (klass != null) {
-                System.out.println(tr("loading plugin ''{0}'' (version {1})", plugin.name, plugin.localversion));
+                Main.info(tr("loading plugin ''{0}'' (version {1})", plugin.name, plugin.localversion));
                 PluginProxy pluginProxy = plugin.load(klass);
                 pluginList.add(pluginProxy);
@@ -528,10 +553,10 @@
             msg = null;
         } catch (PluginException e) {
-            System.err.println(e.getMessage());
+            Main.error(e.getMessage());
             Throwable cause = e.getCause();
             if (cause != null) {
                 msg = cause.getLocalizedMessage();
                 if (msg != null) {
-                    System.err.println("Cause: " + cause.getClass().getName()+": " + msg);
+                    Main.error("Cause: " + cause.getClass().getName()+": " + msg);
                 } else {
                     cause.printStackTrace();
@@ -545,5 +570,5 @@
             e.printStackTrace();
         }
-        if(msg != null && confirmDisablePlugin(parent, msg, plugin.name)) {
+        if (msg != null && confirmDisablePlugin(parent, msg, plugin.name)) {
             Main.pref.removeFromCollection("plugins", plugin.name);
         }
@@ -554,4 +579,5 @@
      * memory.
      *
+     * @param parent The parent component to be used for the displayed dialog
      * @param plugins the list of plugins
      * @param monitor the progress monitor. Defaults to {@link NullProgressMonitor#INSTANCE} if null.
@@ -621,4 +647,5 @@
      * set to false.
      *
+     * @param parent The parent component to be used for the displayed dialog
      * @param plugins the collection of plugins
      * @param monitor the progress monitor. Defaults to {@link NullProgressMonitor#INSTANCE} if null.
@@ -698,4 +725,5 @@
      * messages.
      *
+     * @param parent The parent component to be used for the displayed dialog
      * @param monitor the progress monitor. Defaults to {@link NullProgressMonitor#INSTANCE} if null.
      * @return the set of plugins to load (as set of plugin names)
@@ -785,5 +813,5 @@
                     }
                 } catch (PluginException e) {
-                    System.out.println(tr("Warning: failed to find plugin {0}", name));
+                    Main.warn(tr("Failed to find plugin {0}", name));
                     e.printStackTrace();
                 }
@@ -801,5 +829,5 @@
      * @throws IllegalArgumentException thrown if plugins is null
      */
-    public static List<PluginInformation>  updatePlugins(Component parent,
+    public static List<PluginInformation> updatePlugins(Component parent,
             List<PluginInformation> plugins, ProgressMonitor monitor)
             throws IllegalArgumentException{
@@ -825,10 +853,10 @@
                 allPlugins = task1.getAvailablePlugins();
                 plugins = buildListOfPluginsToLoad(parent,monitor.createSubTaskMonitor(1, false));
-            } catch(ExecutionException e) {
-                System.out.println(tr("Warning: failed to download plugin information list"));
+            } catch (ExecutionException e) {
+                Main.warn(tr("Failed to download plugin information list"));
                 e.printStackTrace();
                 // don't abort in case of error, continue with downloading plugins below
-            } catch(InterruptedException e) {
-                System.out.println(tr("Warning: failed to download plugin information list"));
+            } catch (InterruptedException e) {
+                Main.warn(tr("Failed to download plugin information list"));
                 e.printStackTrace();
                 // don't abort in case of error, continue with downloading plugins below
@@ -838,5 +866,5 @@
             //
             Collection<PluginInformation> pluginsToUpdate = new ArrayList<PluginInformation>();
-            for(PluginInformation pi: plugins) {
+            for (PluginInformation pi: plugins) {
                 if (pi.isUpdateRequired()) {
                     pluginsToUpdate.add(pi);
@@ -907,5 +935,6 @@
     /**
      * Ask the user for confirmation that a plugin shall be disabled.
-     *
+     * 
+     * @param parent The parent component to be used for the displayed dialog
      * @param reason the reason for disabling the plugin
      * @param name the plugin name
@@ -940,7 +969,12 @@
     }
 
+    /**
+     * Returns the plugin of the specified name.
+     * @param name The plugin name
+     * @return The plugin of the specified name, if installed and loaded, or {@code null} otherwise.
+     */
     public static Object getPlugin(String name) {
         for (PluginProxy plugin : pluginList)
-            if(plugin.getPluginInformation().name.equals(name))
+            if (plugin.getPluginInformation().name.equals(name))
                 return plugin.plugin;
         return null;
@@ -986,6 +1020,6 @@
             if (plugin.exists()) {
                 if (!plugin.delete() && dowarn) {
-                    System.err.println(tr("Warning: failed to delete outdated plugin ''{0}''.", plugin.toString()));
-                    System.err.println(tr("Warning: failed to install already downloaded plugin ''{0}''. Skipping installation. JOSM is still going to load the old plugin version.", pluginName));
+                    Main.warn(tr("Failed to delete outdated plugin ''{0}''.", plugin.toString()));
+                    Main.warn(tr("Failed to install already downloaded plugin ''{0}''. Skipping installation. JOSM is still going to load the old plugin version.", pluginName));
                     continue;
                 }
@@ -996,5 +1030,5 @@
             } catch (Exception e) {
                 if (dowarn) {
-                    System.err.println(tr("Warning: failed to install plugin ''{0}'' from temporary download file ''{1}''. {2}", plugin.toString(), updatedPlugin.toString(), e.getLocalizedMessage()));
+                    Main.warn(tr("Failed to install plugin ''{0}'' from temporary download file ''{1}''. {2}", plugin.toString(), updatedPlugin.toString(), e.getLocalizedMessage()));
                 }
                 continue;
@@ -1002,6 +1036,6 @@
             // Install plugin
             if (!updatedPlugin.renameTo(plugin) && dowarn) {
-                System.err.println(tr("Warning: failed to install plugin ''{0}'' from temporary download file ''{1}''. Renaming failed.", plugin.toString(), updatedPlugin.toString()));
-                System.err.println(tr("Warning: failed to install already downloaded plugin ''{0}''. Skipping installation. JOSM is still going to load the old plugin version.", pluginName));
+                Main.warn(tr("Failed to install plugin ''{0}'' from temporary download file ''{1}''. Renaming failed.", plugin.toString(), updatedPlugin.toString()));
+                Main.warn(tr("Failed to install already downloaded plugin ''{0}''. Skipping installation. JOSM is still going to load the old plugin version.", pluginName));
             }
         }
@@ -1177,6 +1211,10 @@
     }
 
+    /**
+     * Returns the list of loaded plugins as a {@code String} to be displayed in status report. Useful for bug reports.
+     * @return The list of loaded plugins (one plugin per line)
+     */
     public static String getBugReportText() {
-        String text = "";
+        StringBuilder text = new StringBuilder();
         LinkedList <String> pl = new LinkedList<String>(Main.pref.getCollection("plugins", new LinkedList<String>()));
         for (final PluginProxy pp : pluginList) {
@@ -1188,9 +1226,13 @@
         Collections.sort(pl);
         for (String s : pl) {
-            text += "Plugin: " + s + "\n";
-        }
-        return text;
-    }
-
+            text.append("Plugin: ").append(s).append("\n");
+        }
+        return text.toString();
+    }
+
+    /**
+     * Returns the list of loaded plugins as a {@code JPanel} to be displayed in About dialog.
+     * @return The list of loaded plugins (one "line" of Swing components per plugin)
+     */
     public static JPanel getInfoPanel() {
         JPanel pluginTab = new JPanel(new GridBagLayout());
Index: /trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java	(revision 6248)
@@ -23,4 +23,5 @@
 import java.util.jar.JarInputStream;
 import java.util.jar.Manifest;
+
 import javax.swing.ImageIcon;
 
@@ -186,5 +187,5 @@
                 new URL(s);
             } catch (MalformedURLException e) {
-                System.out.println(tr("Invalid URL ''{0}'' in plugin {1}", s, name));
+                Main.info(tr("Invalid URL ''{0}'' in plugin {1}", s, name));
                 s = null;
             }
@@ -200,5 +201,5 @@
                     s = tr(s);
                 } catch (IllegalArgumentException e) {
-                    System.out.println(tr("Invalid plugin description ''{0}'' in plugin {1}", s, name));
+                    Main.info(tr("Invalid plugin description ''{0}'' in plugin {1}", s, name));
                 }
             }
Index: /trunk/src/org/openstreetmap/josm/plugins/ReadLocalPluginInformationTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/ReadLocalPluginInformationTask.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/plugins/ReadLocalPluginInformationTask.java	(revision 6248)
@@ -14,4 +14,5 @@
 import java.util.Map;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
@@ -90,5 +91,5 @@
                 processLocalPluginInformationFile(f);
             } catch(PluginListParseException e) {
-                System.err.println(tr("Warning: Failed to scan file ''{0}'' for plugin information. Skipping.", fname));
+                Main.warn(tr("Failed to scan file ''{0}'' for plugin information. Skipping.", fname));
                 e.printStackTrace();
             }
@@ -151,6 +152,6 @@
                 }
             } catch (PluginException e){
-                System.err.println(e.getMessage());
-                System.err.println(tr("Warning: Failed to scan file ''{0}'' for plugin information. Skipping.", fname));
+                Main.warn("PluginException: "+e.getMessage());
+                Main.warn(tr("Failed to scan file ''{0}'' for plugin information. Skipping.", fname));
             }
             monitor.worked(1);
Index: /trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java	(revision 6248)
@@ -259,5 +259,5 @@
             if (!pluginDir.exists()) {
                 if (! pluginDir.mkdirs()) {
-                    System.err.println(tr("Warning: failed to create plugin directory ''{0}''. Cannot cache plugin list from plugin site ''{1}''.", pluginDir.toString(), site));
+                    Main.warn(tr("Failed to create plugin directory ''{0}''. Cannot cache plugin list from plugin site ''{1}''.", pluginDir.toString(), site));
                 }
             }
@@ -311,9 +311,9 @@
             List<PluginInformation> pis = new PluginListParser().parse(in);
             availablePlugins.addAll(filterDeprecatedPlugins(pis));
-        } catch(UnsupportedEncodingException e) {
-            System.err.println(tr("Failed to parse plugin list document from site ''{0}''. Skipping site. Exception was: {1}", site, e.toString()));
-            e.printStackTrace();
-        } catch(PluginListParseException e) {
-            System.err.println(tr("Failed to parse plugin list document from site ''{0}''. Skipping site. Exception was: {1}", site, e.toString()));
+        } catch (UnsupportedEncodingException e) {
+            Main.error(tr("Failed to parse plugin list document from site ''{0}''. Skipping site. Exception was: {1}", site, e.toString()));
+            e.printStackTrace();
+        } catch (PluginListParseException e) {
+            Main.error(tr("Failed to parse plugin list document from site ''{0}''. Skipping site. Exception was: {1}", site, e.toString()));
             e.printStackTrace();
         }
Index: /trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java	(revision 6248)
@@ -370,6 +370,6 @@
                 try {
                     closeDate = formatter.parse(m.group(2));
-                } catch(ParseException ex) {
-                    System.err.println(tr("Failed to parse date ''{0}'' replied by server.", m.group(2)));
+                } catch (ParseException ex) {
+                    Main.error(tr("Failed to parse date ''{0}'' replied by server.", m.group(2)));
                     ex.printStackTrace();
                 }
Index: /trunk/src/org/openstreetmap/josm/tools/I18n.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/I18n.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/tools/I18n.java	(revision 6248)
@@ -5,6 +5,6 @@
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.IOException;
 import java.io.InputStream;
-import java.io.IOException;
 import java.net.URL;
 import java.text.MessageFormat;
@@ -14,7 +14,7 @@
 import java.util.Comparator;
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.jar.JarInputStream;
 import java.util.zip.ZipEntry;
-import java.util.Locale;
 
 import javax.swing.JColorChooser;
@@ -641,5 +641,5 @@
             } else {
                 if (!l.getLanguage().equals("en")) {
-                    System.out.println(tr("Unable to find translation for the locale {0}. Reverting to {1}.",
+                    Main.info(tr("Unable to find translation for the locale {0}. Reverting to {1}.",
                             l.getDisplayName(), Locale.getDefault().getDisplayName()));
                 } else {
Index: /trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 6248)
@@ -308,5 +308,5 @@
             } else {
                 if (!suppressWarnings) {
-                    System.err.println(tr("Failed to locate image ''{0}''", name));
+                    Main.error(tr("Failed to locate image ''{0}''", name));
                 }
                 return null;
@@ -613,5 +613,5 @@
             }
         } catch (Exception e) {
-            System.err.println(tr("Warning: failed to handle zip file ''{0}''. Exception was: {1}", archive.getName(), e.toString()));
+            Main.warn(tr("Failed to handle zip file ''{0}''. Exception was: {1}", archive.getName(), e.toString()));
         } finally {
             Utils.close(zipFile);
@@ -671,6 +671,6 @@
                         return u;
                 } catch (SecurityException e) {
-                    System.out.println(tr(
-                            "Warning: failed to access directory ''{0}'' for security reasons. Exception was: {1}",
+                    Main.warn(tr(
+                            "Failed to access directory ''{0}'' for security reasons. Exception was: {1}",
                             name, e.toString()));
                 }
@@ -685,6 +685,6 @@
                 return u;
         } catch (SecurityException e) {
-            System.out.println(tr(
-                    "Warning: failed to access directory ''{0}'' for security reasons. Exception was: {1}", dir, e
+            Main.warn(tr(
+                    "Failed to access directory ''{0}'' for security reasons. Exception was: {1}", dir, e
                     .toString()));
         }
@@ -736,5 +736,4 @@
                 @Override
                 public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
-                    System.out.println();
                     if (localName.equalsIgnoreCase("img")) {
                         String val = atts.getValue("src");
@@ -759,8 +758,8 @@
             return r.getResult();
         } catch (Exception e) {
-            System.out.println("INFO: parsing " + base + fn + " failed:\n" + e);
+            Main.warn("Parsing " + base + fn + " failed:\n" + e);
             return null;
         }
-        System.out.println("INFO: parsing " + base + fn + " failed: Unexpected content.");
+        Main.warn("Parsing " + base + fn + " failed: Unexpected content.");
         return null;
     }
Index: /trunk/src/org/openstreetmap/josm/tools/OpenBrowser.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/OpenBrowser.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/tools/OpenBrowser.java	(revision 6248)
@@ -51,5 +51,5 @@
                     // Workaround for KDE (Desktop API is severely flawed)
                     // see http://bugs.sun.com/view_bug.do?bug_id=6486393
-                    System.err.println("Warning: Desktop class failed. Platform dependent fall back for open url in browser.");
+                    Main.warn("Desktop class failed. Platform dependent fall back for open url in browser.");
                     displayUrlFallback(uri);
                 }
@@ -60,5 +60,5 @@
         } else {
             try {
-                System.err.println("Warning: Desktop class is not supported. Platform dependent fall back for open url in browser.");
+                Main.warn("Desktop class is not supported. Platform dependent fall back for open url in browser.");
                 displayUrlFallback(uri);
             } catch (IOException e) {
Index: /trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java	(revision 6248)
@@ -40,8 +40,6 @@
             MsetEnabledPreferencesMenu.invoke(Ocom_apple_eawt_Application, new Object[] { Boolean.TRUE });
         } catch (Exception ex) {
-            // Oops, what now?
-            // We'll just ignore this for now. The user will still be able to close JOSM
-            // by closing all its windows.
-            System.out.println("Failed to register with OSX: " + ex);
+            // We'll just ignore this for now. The user will still be able to close JOSM by closing all its windows.
+            Main.warn("Failed to register with OSX: " + ex);
         }
     }
@@ -49,5 +47,4 @@
     public Object invoke (Object proxy, Method method, Object[] args) throws Throwable {
         Boolean handled = Boolean.TRUE;
-        //System.out.println("Going to handle method "+method+" (short: "+method.getName()+") with event "+args[0]);
         if (method.getName().equals("handleQuit")) {
             handled = Main.exitJosm(false, 0);
@@ -62,5 +59,5 @@
                 args[0].getClass().getDeclaredMethod("setHandled", new Class[] { boolean.class }).invoke(args[0], new Object[] { handled });
             } catch (Exception ex) {
-                System.out.println("Failed to report handled event: " + ex);
+                Main.warn("Failed to report handled event: " + ex);
             }
         }
@@ -69,5 +66,4 @@
     @Override
     public void openUrl(String url) throws IOException {
-        // Ain't that KISS?
         Runtime.getRuntime().exec("open " + url);
     }
Index: /trunk/src/org/openstreetmap/josm/tools/Shortcut.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/Shortcut.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/tools/Shortcut.java	(revision 6248)
@@ -371,5 +371,5 @@
         if (potentialShortcut != null) {
             // this always is a logic error in the hook
-            System.err.println("CONFLICT WITH SYSTEM KEY "+shortText);
+            Main.error("CONFLICT WITH SYSTEM KEY "+shortText);
             return null;
         }
@@ -415,5 +415,5 @@
                     if ( findShortcut(k, newmodifier) == null ) {
                         Shortcut newsc = new Shortcut(shortText, longText, requestedKey, m, k, newmodifier, false, false);
-                        System.out.println(tr("Silent shortcut conflict: ''{0}'' moved by ''{1}'' to ''{2}''.",
+                        Main.info(tr("Silent shortcut conflict: ''{0}'' moved by ''{1}'' to ''{2}''.",
                             shortText, conflict.getShortText(), newsc.getKeyText()));
                         newsc.saveDefault();
Index: /trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java	(revision 6247)
+++ /trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java	(revision 6248)
@@ -24,4 +24,5 @@
 import javax.xml.validation.ValidatorHandler;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.io.MirroredInputStream;
 import org.xml.sax.Attributes;
@@ -296,5 +297,5 @@
             } catch (SAXException e) {
                 // Exception very unlikely to happen, so no need to translate this
-                System.err.println("Cannot disable 'load-external-dtd' feature: "+e.getMessage());
+                Main.error("Cannot disable 'load-external-dtd' feature: "+e.getMessage());
             }
             reader.parse(new InputSource(in));
