Index: trunk/src/org/openstreetmap/josm/gui/io/AbstractUploadTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/AbstractUploadTask.java	(revision 12542)
+++ trunk/src/org/openstreetmap/josm/gui/io/AbstractUploadTask.java	(revision 12620)
@@ -34,4 +34,5 @@
 import org.openstreetmap.josm.tools.ExceptionUtil;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Pair;
 import org.openstreetmap.josm.tools.date.DateUtils;
@@ -298,5 +299,5 @@
             }
         }
-        Main.warn(tr("Error header \"{0}\" did not match with an expected pattern", errorHeader));
+        Logging.warn(tr("Error header \"{0}\" did not match with an expected pattern", errorHeader));
         handleUploadConflictForUnknownConflict();
     }
@@ -313,5 +314,5 @@
             handleUploadPreconditionFailedConflict(e, conflict);
         } else {
-            Main.warn(tr("Error header \"{0}\" did not match with an expected pattern", e.getErrorHeader()));
+            Logging.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 12542)
+++ trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java	(revision 12620)
@@ -39,4 +39,5 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.InputMapUtils;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.WindowGeometry;
 
@@ -113,5 +114,5 @@
             setAlwaysOnTop(true);
         } catch (SecurityException e) {
-            Main.warn(e, tr("Failed to put Credential Dialog always on top. Caught security exception."));
+            Logging.log(Logging.LEVEL_WARN, tr("Failed to put Credential Dialog always on top. Caught security exception."), e);
         }
         build();
Index: trunk/src/org/openstreetmap/josm/gui/io/DownloadFileTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/DownloadFileTask.java	(revision 12542)
+++ trunk/src/org/openstreetmap/josm/gui/io/DownloadFileTask.java	(revision 12620)
@@ -19,8 +19,8 @@
 import java.util.zip.ZipFile;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.PleaseWaitDialog;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
 import org.openstreetmap.josm.tools.HttpClient;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 import org.xml.sax.SAXException;
@@ -133,7 +133,7 @@
             }
             if (!canceled) {
-                Main.info(tr("Download finished"));
+                Logging.info(tr("Download finished"));
                 if (unpack) {
-                    Main.info(tr("Unpacking {0} into {1}", file.getAbsolutePath(), file.getParent()));
+                    Logging.info(tr("Unpacking {0} into {1}", file.getAbsolutePath(), file.getParent()));
                     unzipFileRecursively(file, file.getParent());
                     Utils.deleteFile(file);
@@ -143,5 +143,5 @@
             String msg = tr("Cannot download file ''{0}''. Its download link ''{1}'' is not a valid URL. Skipping download.",
                     file.getName(), address);
-            Main.warn(msg);
+            Logging.warn(msg);
             throw new DownloadException(msg, e);
         } catch (IOException e) {
@@ -160,5 +160,5 @@
             download();
         } catch (DownloadException e) {
-            Main.error(e);
+            Logging.error(e);
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java	(revision 12542)
+++ trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java	(revision 12620)
@@ -25,4 +25,5 @@
 import org.openstreetmap.josm.io.OsmServerUserInfoReader;
 import org.openstreetmap.josm.io.OsmTransferException;
+import org.openstreetmap.josm.tools.Logging;
 import org.xml.sax.SAXException;
 
@@ -65,5 +66,5 @@
                     + "You have either chosen to work anonymously or you are not entitled<br>"
                     + "to know the identity of the user on whose behalf you are working.");
-            Main.warn(msg);
+            Logging.warn(msg);
             if (!GraphicsEnvironment.isHeadless()) {
                 JOptionPane.showMessageDialog(GuiHelper.getFrameForComponent(parent),
@@ -113,5 +114,6 @@
                 im.setPartiallyIdentified(im.getUserName());
             }
-            Main.warn(e, tr("Failed to retrieve user infos for the current JOSM user. Exception was: {0}", e.toString()));
+            Logging.log(Logging.LEVEL_WARN,
+                    tr("Failed to retrieve user infos for the current JOSM user. Exception was: {0}", e.toString()), e);
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/io/SaveLayerTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/SaveLayerTask.java	(revision 12542)
+++ trunk/src/org/openstreetmap/josm/gui/io/SaveLayerTask.java	(revision 12620)
@@ -6,5 +6,4 @@
 import java.util.Optional;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.SaveAction;
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
@@ -12,4 +11,5 @@
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.JosmRuntimeException;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -57,5 +57,5 @@
             }
         } catch (JosmRuntimeException | IllegalArgumentException | IllegalStateException e) {
-            Main.error(e);
+            Logging.error(e);
             setLastException(e);
         }
Index: trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java	(revision 12542)
+++ trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java	(revision 12620)
@@ -55,4 +55,5 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.InputMapUtils;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.UserCancelException;
 import org.openstreetmap.josm.tools.Utils;
@@ -446,5 +447,5 @@
                 closeDialog();
             } catch (UserCancelException ignore) {
-                Main.trace(ignore);
+                Logging.trace(ignore);
             }
         }
@@ -575,8 +576,8 @@
                     currentFuture.get();
                 } catch (CancellationException e) {
-                    Main.trace(e);
+                    Logging.trace(e);
                     model.setUploadState(layer, UploadOrSaveState.CANCELED);
                 } catch (InterruptedException | ExecutionException e) {
-                    Main.error(e);
+                    Logging.error(e);
                     model.setUploadState(layer, UploadOrSaveState.FAILED);
                     ExceptionDialogUtil.explainException(e);
@@ -585,5 +586,5 @@
                     model.setUploadState(layer, UploadOrSaveState.CANCELED);
                 } else if (currentTask.isFailed()) {
-                    Main.error(currentTask.getLastException());
+                    Logging.error(currentTask.getLastException());
                     ExceptionDialogUtil.explainException(currentTask.getLastException());
                     model.setUploadState(layer, UploadOrSaveState.FAILED);
@@ -616,8 +617,8 @@
                     currentFuture.get();
                 } catch (CancellationException e) {
-                    Main.trace(e);
+                    Logging.trace(e);
                     model.setSaveState(layerInfo.getLayer(), UploadOrSaveState.CANCELED);
                 } catch (InterruptedException | ExecutionException e) {
-                    Main.error(e);
+                    Logging.error(e);
                     model.setSaveState(layerInfo.getLayer(), UploadOrSaveState.FAILED);
                     ExceptionDialogUtil.explainException(e);
@@ -627,5 +628,5 @@
                 } else if (currentTask.isFailed()) {
                     if (currentTask.getLastException() != null) {
-                        Main.error(currentTask.getLastException());
+                        Logging.error(currentTask.getLastException());
                         ExceptionDialogUtil.explainException(currentTask.getLastException());
                     }
@@ -642,5 +643,5 @@
             if (numProblems == 0)
                 return;
-            Main.warn(numProblems + " problems occured during upload/save");
+            Logging.warn(numProblems + " problems occured during upload/save");
             String msg = trn(
                     "<html>An upload and/or save operation of one layer with modifications<br>"
Index: trunk/src/org/openstreetmap/josm/gui/io/UploadLayerTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/UploadLayerTask.java	(revision 12542)
+++ trunk/src/org/openstreetmap/josm/gui/io/UploadLayerTask.java	(revision 12620)
@@ -9,5 +9,4 @@
 import java.util.Set;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.upload.CyclicUploadDependencyException;
 import org.openstreetmap.josm.data.APIDataSet;
@@ -25,4 +24,5 @@
 import org.openstreetmap.josm.io.OsmTransferException;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -91,5 +91,5 @@
         if (p.isDeleted()) {
             // we tried to delete an already deleted primitive.
-            Main.warn(tr("Object ''{0}'' is already deleted on the server. Skipping this object and retrying to upload.",
+            Logging.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());
@@ -134,5 +134,5 @@
         } catch (OsmTransferException sxe) {
             if (isCanceled()) {
-                Main.info("Ignoring exception caught because upload is canceled. Exception is: " + sxe);
+                Logging.info("Ignoring exception caught because upload is canceled. Exception is: " + sxe);
                 return;
             }
Index: trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java	(revision 12542)
+++ trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java	(revision 12620)
@@ -38,4 +38,5 @@
 import org.openstreetmap.josm.io.OsmTransferException;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -200,5 +201,5 @@
             }
             monitor.appendLogMessage(msg);
-            Main.warn(msg);
+            Logging.warn(msg);
             processedPrimitives.addAll(writer.getProcessedPrimitives());
             processedPrimitives.add(p);
@@ -224,9 +225,9 @@
             SwingUtilities.invokeAndWait(r);
         } catch (InterruptedException e) {
-            Main.trace(e);
+            Logging.trace(e);
             lastException = e;
             Thread.currentThread().interrupt();
         } catch (InvocationTargetException e) {
-            Main.trace(e);
+            Logging.trace(e);
             lastException = new OsmTransferException(e.getCause());
         }
@@ -249,5 +250,5 @@
                     break;
                 } catch (OsmTransferCanceledException e) {
-                    Main.error(e);
+                    Logging.error(e);
                     uploadCanceled = true;
                     break uploadloop;
@@ -292,5 +293,5 @@
         } catch (OsmTransferException e) {
             if (uploadCanceled) {
-                Main.info(tr("Ignoring caught exception because upload is canceled. Exception is: {0}", e.toString()));
+                Logging.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/UploadStrategy.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/UploadStrategy.java	(revision 12542)
+++ trunk/src/org/openstreetmap/josm/gui/io/UploadStrategy.java	(revision 12620)
@@ -7,4 +7,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -96,5 +97,5 @@
         UploadStrategy strategy = fromPreference(v);
         if (strategy == null) {
-            Main.warn(tr("Unexpected value for key ''{0}'' in preferences, got ''{1}''", "osm-server.upload-strategy", v));
+            Logging.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/io/UploadStrategySelectionPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanel.java	(revision 12542)
+++ trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanel.java	(revision 12620)
@@ -36,4 +36,5 @@
 import org.openstreetmap.josm.io.Capabilities;
 import org.openstreetmap.josm.io.OsmApi;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -336,5 +337,5 @@
         } catch (NumberFormatException e) {
             // don't save invalid value to preferences
-            Main.trace(e);
+            Logging.trace(e);
         }
     }
