Index: trunk/src/org/openstreetmap/josm/io/AbstractReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/AbstractReader.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/AbstractReader.java	(revision 12620)
@@ -12,5 +12,4 @@
 import java.util.Map.Entry;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.Changeset;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -25,4 +24,5 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -105,5 +105,5 @@
                 }
                 if (n.isDeleted()) {
-                    Main.info(tr("Deleted node {0} is part of way {1}", id, w.getId()));
+                    Logging.info(tr("Deleted node {0} is part of way {1}", id, w.getId()));
                 } else {
                     wayNodes.add(n);
@@ -112,5 +112,5 @@
             w.setNodes(wayNodes);
             if (w.hasIncompleteNodes()) {
-                Main.info(tr("Way {0} with {1} nodes has incomplete nodes because at least one node was missing in the loaded data.",
+                Logging.info(tr("Way {0} with {1} nodes has incomplete nodes because at least one node was missing in the loaded data.",
                           externalWayId, w.getNodesCount()));
             }
@@ -176,5 +176,5 @@
                 }
                 if (primitive.isDeleted()) {
-                    Main.info(tr("Deleted member {0} is used by relation {1}", primitive.getId(), relation.getId()));
+                    Logging.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/BoundingBoxDownloader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java	(revision 12620)
@@ -9,5 +9,4 @@
 import java.util.List;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.DataSource;
@@ -18,4 +17,5 @@
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.JosmRuntimeException;
+import org.openstreetmap.josm.tools.Logging;
 import org.xml.sax.SAXException;
 
@@ -75,5 +75,5 @@
                     final OsmTransferCanceledException canceledException = new OsmTransferCanceledException("Operation canceled");
                     canceledException.initCause(ex);
-                    Main.warn(canceledException);
+                    Logging.warn(canceledException);
                 }
             }
Index: trunk/src/org/openstreetmap/josm/io/CacheCustomContent.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/CacheCustomContent.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/CacheCustomContent.java	(revision 12620)
@@ -12,4 +12,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -99,5 +100,5 @@
             return false;
         } catch (OfflineAccessException e) {
-            Main.trace(e);
+            Logging.trace(e);
             return true;
         }
@@ -187,8 +188,8 @@
             this.data = new byte[input.available()];
             if (input.read(this.data) < this.data.length) {
-                Main.error("Failed to read expected contents from "+path);
+                Logging.error("Failed to read expected contents from "+path);
             }
         } catch (IOException e) {
-            Main.trace(e);
+            Logging.trace(e);
             if (!isOffline()) {
                 this.data = updateForce();
@@ -205,5 +206,5 @@
             output.flush();
         } catch (IOException e) {
-            Main.error(e);
+            Logging.error(e);
         }
     }
Index: trunk/src/org/openstreetmap/josm/io/CachedFile.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/CachedFile.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/CachedFile.java	(revision 12620)
@@ -29,4 +29,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.tools.HttpClient;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Pair;
 import org.openstreetmap.josm.tools.Utils;
@@ -327,5 +328,5 @@
             file = getFile();
         } catch (IOException ex) {
-            Main.warn(ex, false);
+            Logging.log(Logging.LEVEL_WARN, ex);
         }
         if (file == null)
@@ -351,6 +352,7 @@
         } catch (IOException e) {
             if (file.getName().endsWith(".zip")) {
-                Main.warn(e, tr("Failed to open file with extension ''{2}'' and namepart ''{3}'' in zip file ''{0}''. Exception was: {1}",
-                        file.getName(), e.toString(), extension, namepart));
+                Logging.log(Logging.LEVEL_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), e);
             }
         }
@@ -389,5 +391,5 @@
             }
         } catch (MalformedURLException e) {
-            Main.warn(e);
+            Logging.warn(e);
         }
     }
@@ -422,5 +424,5 @@
             checkOfflineAccess(urlStr);
         } catch (OfflineAccessException e) {
-            Main.trace(e);
+            Logging.trace(e);
             offline = true;
         }
@@ -471,7 +473,5 @@
             final HttpClient.Response con = activeConnection.connect();
             if (ifModifiedSince != null && con.getResponseCode() == HttpURLConnection.HTTP_NOT_MODIFIED) {
-                if (Main.isDebugEnabled()) {
-                    Main.debug("304 Not Modified ("+urlStr+')');
-                }
+                Logging.debug("304 Not Modified ({0})", urlStr);
                 if (localFile == null)
                     throw new AssertionError();
@@ -491,10 +491,10 @@
                         Arrays.asList(Long.toString(System.currentTimeMillis()), localFile.toString()));
             } else {
-                Main.warn(tr("Failed to rename file {0} to {1}.",
+                Logging.warn(tr("Failed to rename file {0} to {1}.",
                 destDirFile.getPath(), localFile.getPath()));
             }
         } catch (IOException e) {
             if (age >= maxAgeMillis && age < maxAgeMillis*2) {
-                Main.warn(tr("Failed to load {0}, use cached file and retry next time: {1}", urlStr, e));
+                Logging.warn(tr("Failed to load {0}, use cached file and retry next time: {1}", urlStr, e));
                 return localFile;
             } else {
Index: trunk/src/org/openstreetmap/josm/io/Capabilities.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/Capabilities.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/Capabilities.java	(revision 12620)
@@ -13,5 +13,5 @@
 import javax.xml.parsers.ParserConfigurationException;
 
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 import org.xml.sax.Attributes;
@@ -161,5 +161,5 @@
 
     private static void warnIllegalValue(String attr, String elem, Object val) {
-        Main.warn(tr("Illegal value of attribute ''{0}'' of element ''{1}'' in server capabilities. Got ''{2}''", attr, elem, val));
+        Logging.warn(tr("Illegal value of attribute ''{0}'' of element ''{1}'' in server capabilities. Got ''{2}''", attr, elem, val));
     }
 
Index: trunk/src/org/openstreetmap/josm/io/CertificateAmendment.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/CertificateAmendment.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/CertificateAmendment.java	(revision 12620)
@@ -29,4 +29,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -144,5 +145,5 @@
             }
         } catch (KeyStoreException | NoSuchAlgorithmException | CertificateException | IOException | IllegalStateException e) {
-            Main.error(e);
+            Logging.error(e);
         }
 
@@ -166,6 +167,6 @@
             }
             if (certificateIsMissing(keyStore, cert)) {
-                if (Main.isDebugEnabled()) {
-                    Main.debug(tr("Adding certificate for TLS connections: {0}", cert.getSubjectX500Principal().getName()));
+                if (Logging.isDebugEnabled()) {
+                    Logging.debug(tr("Adding certificate for TLS connections: {0}", cert.getSubjectX500Principal().getName()));
                 }
                 String alias = "josm:" + new File(certAmend.id).getName();
Index: trunk/src/org/openstreetmap/josm/io/ChangesetClosedException.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/ChangesetClosedException.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/ChangesetClosedException.java	(revision 12620)
@@ -9,5 +9,5 @@
 import java.util.regex.Pattern;
 
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.date.DateUtils;
 
@@ -78,9 +78,9 @@
                 closedOn = DateUtils.newOsmApiDateTimeFormat().parse(m.group(2));
             } catch (ParseException ex) {
-                Main.error(tr("Failed to parse date ''{0}'' replied by server.", m.group(2)));
-                Main.error(ex);
+                Logging.error(tr("Failed to parse date ''{0}'' replied by server.", m.group(2)));
+                Logging.error(ex);
             }
         } else {
-            Main.error(tr("Unexpected format of error header for conflict in changeset update. Got ''{0}''", errorHeader));
+            Logging.error(tr("Unexpected format of error header for conflict in changeset update. Got ''{0}''", errorHeader));
         }
     }
Index: trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java	(revision 12620)
@@ -16,9 +16,9 @@
 import java.util.stream.Stream;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.gui.JosmUserIdentityManager;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 import org.openstreetmap.josm.tools.date.DateUtils;
@@ -267,5 +267,5 @@
         CheckParameterUtil.ensureParameterNotNull(changesetIds, "changesetIds");
         if (changesetIds.size() > MAX_CHANGESETS_NUMBER) {
-            Main.warn("Changeset query built with more than " + MAX_CHANGESETS_NUMBER + " changeset ids (" + changesetIds.size() + ')');
+            Logging.warn("Changeset query built with more than " + MAX_CHANGESETS_NUMBER + " changeset ids (" + changesetIds.size() + ')');
         }
         this.changesetIds = changesetIds;
@@ -471,5 +471,5 @@
                         break;
                     default:
-                        Main.warn("Unable to parse time: " + entry.getValue());
+                        Logging.warn("Unable to parse time: " + entry.getValue());
                     }
                     break;
Index: trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java	(revision 12620)
@@ -21,4 +21,5 @@
 import org.openstreetmap.josm.gui.preferences.server.ProxyPreferencesPanel;
 import org.openstreetmap.josm.gui.preferences.server.ProxyPreferencesPanel.ProxyPolicy;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -93,11 +94,11 @@
             port = Integer.parseInt(value);
         } catch (NumberFormatException e) {
-            Main.error(tr("Unexpected format for port number in preference ''{0}''. Got ''{1}''.", property, value));
-            Main.error(tr("The proxy will not be used."));
+            Logging.error(tr("Unexpected format for port number in preference ''{0}''. Got ''{1}''.", property, value));
+            Logging.error(tr("The proxy will not be used."));
             return 0;
         }
         if (port <= 0 || port > 65_535) {
-            Main.error(tr("Illegal port number in preference ''{0}''. Got {1}.", property, port));
-            Main.error(tr("The proxy will not be used."));
+            Logging.error(tr("Illegal port number in preference ''{0}''. Got {1}.", property, port));
+            Logging.error(tr("The proxy will not be used."));
             return 0;
         }
@@ -116,5 +117,5 @@
             proxyPolicy = ProxyPolicy.fromName(value);
             if (proxyPolicy == null) {
-                Main.warn(tr("Unexpected value for preference ''{0}'' found. Got ''{1}''. Will use no proxy.",
+                Logging.warn(tr("Unexpected value for preference ''{0}'' found. Got ''{1}''. Will use no proxy.",
                         ProxyPreferencesPanel.PROXY_POLICY, value));
                 proxyPolicy = ProxyPolicy.NO_PROXY;
@@ -128,6 +129,6 @@
                 httpProxySocketAddress = new InetSocketAddress(host, port);
             } else {
-                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."));
+                Logging.warn(tr("Unexpected parameters for HTTP proxy. Got host ''{0}'' and port ''{1}''.", host, port));
+                Logging.warn(tr("The proxy will not be used."));
             }
         }
@@ -140,6 +141,6 @@
                 socksProxySocketAddress = new InetSocketAddress(host, port);
             } else {
-                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."));
+                Logging.warn(tr("Unexpected parameters for SOCKS proxy. Got host ''{0}'' and port ''{1}''.", host, port));
+                Logging.warn(tr("The proxy will not be used."));
             }
         }
@@ -153,5 +154,6 @@
     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
-        Main.error(tr("Connection to proxy ''{0}'' for URI ''{1}'' failed. Exception was: {2}", sa.toString(), uri.toString(), ioe.toString()));
+        Logging.error(tr("Connection to proxy ''{0}'' for URI ''{1}'' failed. Exception was: {2}",
+                sa.toString(), uri.toString(), ioe.toString()));
         // Remember errors to give a friendly user message asking to review proxy configuration
         errorResources.add(uri.toString());
@@ -203,5 +205,5 @@
         case USE_SYSTEM_SETTINGS:
             if (!jvmWillUseSystemProxies) {
-                Main.warn(tr("The JVM is not configured to lookup proxies from the system settings. "+
+                Logging.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 NO_PROXY_LIST;
Index: trunk/src/org/openstreetmap/josm/io/FileImporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/FileImporter.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/FileImporter.java	(revision 12620)
@@ -16,4 +16,5 @@
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import org.openstreetmap.josm.gui.util.GuiHelper;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler;
@@ -89,5 +90,5 @@
     public boolean importDataHandleExceptions(File f, ProgressMonitor progressMonitor) {
         try {
-            Main.info("Open file: " + f.getAbsolutePath() + " (" + f.length() + " bytes)");
+            Logging.info("Open file: " + f.getAbsolutePath() + " (" + f.length() + " bytes)");
             importData(f, progressMonitor);
             return true;
@@ -110,5 +111,5 @@
 
     private static void displayError(File f, Exception e) {
-        Main.error(e);
+        Logging.error(e);
         HelpAwareOptionPane.showMessageDialogInEDT(
                 Main.parent,
@@ -137,9 +138,9 @@
     public boolean importDataHandleExceptions(List<File> files, ProgressMonitor progressMonitor) {
         try {
-            Main.info("Open "+files.size()+" files");
+            Logging.info("Open "+files.size()+" files");
             importData(files, progressMonitor);
             return true;
         } catch (IOException | IllegalDataException e) {
-            Main.error(e);
+            Logging.error(e);
             HelpAwareOptionPane.showMessageDialogInEDT(
                     Main.parent,
Index: trunk/src/org/openstreetmap/josm/io/FileWatcher.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/FileWatcher.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/FileWatcher.java	(revision 12620)
@@ -23,4 +23,5 @@
 import org.openstreetmap.josm.gui.preferences.SourceEntry;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -44,5 +45,5 @@
             thread = new Thread((Runnable) this::processEvents, "File Watcher");
         } catch (IOException e) {
-            Main.error(e);
+            Logging.error(e);
         }
     }
@@ -104,7 +105,5 @@
      */
     private void processEvents() {
-        if (Main.isDebugEnabled()) {
-            Main.debug("File watcher thread started");
-        }
+        Logging.debug("File watcher thread started");
         while (true) {
 
@@ -140,8 +139,8 @@
                     SourceEntry rule = ruleMap.get(fullPath);
                     if (style != null) {
-                        Main.info("Map style "+style.getDisplayString()+" has been modified. Reloading style...");
+                        Logging.info("Map style "+style.getDisplayString()+" has been modified. Reloading style...");
                         Main.worker.submit(new MapPaintStyleLoader(Collections.singleton(style)));
                     } else if (rule != null) {
-                        Main.info("Validator rule "+rule.getDisplayString()+" has been modified. Reloading rule...");
+                        Logging.info("Validator rule "+rule.getDisplayString()+" has been modified. Reloading rule...");
                         MapCSSTagChecker tagChecker = OsmValidator.getTest(MapCSSTagChecker.class);
                         if (tagChecker != null) {
@@ -149,9 +148,9 @@
                                 tagChecker.addMapCSS(rule.url);
                             } catch (IOException | ParseException e) {
-                                Main.warn(e);
+                                Logging.warn(e);
                             }
                         }
-                    } else if (Main.isDebugEnabled()) {
-                        Main.debug("Received "+kind.name()+" event for unregistered file: "+fullPath);
+                    } else if (Logging.isDebugEnabled()) {
+                        Logging.debug("Received {0} event for unregistered file: {1}", kind.name(), fullPath);
                     }
                 }
Index: trunk/src/org/openstreetmap/josm/io/GeoJSONWriter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/GeoJSONWriter.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/GeoJSONWriter.java	(revision 12620)
@@ -18,5 +18,4 @@
 import javax.json.stream.JsonGenerator;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -34,4 +33,5 @@
 import org.openstreetmap.josm.gui.mappaint.ElemStyles;
 import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Pair;
 
@@ -135,6 +135,6 @@
                 geomObj.add("coordinates", multiPolygon);
             } catch (MultipolygonBuilder.JoinedPolygonCreationException ex) {
-                Main.warn("GeoJSON: Failed to export multipolygon {0}", r.getUniqueId());
-                Main.warn(ex);
+                Logging.warn("GeoJSON: Failed to export multipolygon {0}", r.getUniqueId());
+                Logging.warn(ex);
             }
         }
Index: trunk/src/org/openstreetmap/josm/io/GpxExporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/GpxExporter.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/GpxExporter.java	(revision 12620)
@@ -35,4 +35,5 @@
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.GBC;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -205,5 +206,5 @@
             fo.flush();
         } catch (IOException ex) {
-            Main.error(ex);
+            Logging.error(ex);
             JOptionPane.showMessageDialog(Main.parent, tr("Error while exporting {0}:\n{1}", fn, ex.getMessage()),
                     tr("Error"), JOptionPane.ERROR_MESSAGE);
Index: trunk/src/org/openstreetmap/josm/io/GpxImporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/GpxImporter.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/GpxImporter.java	(revision 12620)
@@ -17,4 +17,5 @@
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import org.openstreetmap.josm.gui.util.GuiHelper;
+import org.openstreetmap.josm.tools.Logging;
 import org.xml.sax.SAXException;
 
@@ -105,5 +106,5 @@
             addLayers(loadLayers(r.getGpxData(), parsedProperly, fileName, tr("Markers from {0}", fileName)));
         } catch (SAXException e) {
-            Main.error(e);
+            Logging.error(e);
             throw new IOException(tr("Parsing data for layer ''{0}'' failed", fileName), e);
         }
@@ -184,5 +185,5 @@
             return loadLayers(r.getGpxData(), parsedProperly, gpxLayerName, markerLayerName);
         } catch (SAXException e) {
-            Main.error(e);
+            Logging.error(e);
             throw new IOException(tr("Parsing data for layer ''{0}'' failed", gpxLayerName), e);
         }
Index: trunk/src/org/openstreetmap/josm/io/GpxReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/GpxReader.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/GpxReader.java	(revision 12620)
@@ -17,5 +17,4 @@
 import javax.xml.parsers.ParserConfigurationException;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -27,4 +26,5 @@
 import org.openstreetmap.josm.data.gpx.ImmutableGpxTrack;
 import org.openstreetmap.josm.data.gpx.WayPoint;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 import org.xml.sax.Attributes;
@@ -581,10 +581,10 @@
                     message += ' ' + tr("(at line {0}, column {1})", spe.getLineNumber(), spe.getColumnNumber());
                 }
-                Main.warn(message);
+                Logging.warn(message);
                 return false;
             } else
                 throw e;
         } catch (ParserConfigurationException e) {
-            Main.error(e); // broken SAXException chaining
+            Logging.error(e); // broken SAXException chaining
             throw new SAXException(e);
         }
Index: trunk/src/org/openstreetmap/josm/io/InvalidXmlCharacterFilter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/InvalidXmlCharacterFilter.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/InvalidXmlCharacterFilter.java	(revision 12620)
@@ -5,5 +5,5 @@
 import java.io.Reader;
 
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -64,5 +64,5 @@
         if (in < 0x20 && INVALID_CHARS[in]) {
             if (firstWarning) {
-                Main.warn("Invalid xml character encountered: '"+in+"'.");
+                Logging.warn("Invalid xml character encountered: '"+in+"'.");
                 firstWarning = false;
             }
Index: trunk/src/org/openstreetmap/josm/io/MessageNotifier.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/MessageNotifier.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/MessageNotifier.java	(revision 12620)
@@ -30,4 +30,5 @@
 import org.openstreetmap.josm.io.auth.JosmPreferencesCredentialAgent;
 import org.openstreetmap.josm.tools.GBC;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -86,5 +87,5 @@
                 }
             } catch (OsmTransferException e) {
-                Main.warn(e);
+                Logging.warn(e);
             }
         }
@@ -97,8 +98,8 @@
         int interval = PROP_INTERVAL.get();
         if (Main.isOffline(OnlineResource.OSM_API)) {
-            Main.info(tr("{0} not available (offline mode)", tr("Message notifier")));
+            Logging.info(tr("{0} not available (offline mode)", tr("Message notifier")));
         } else if (!isRunning() && interval > 0 && isUserEnoughIdentified()) {
             task = EXECUTOR.scheduleAtFixedRate(WORKER, 0, TimeUnit.MINUTES.toSeconds(interval), TimeUnit.SECONDS);
-            Main.info("Message notifier active (checks every "+interval+" minute"+(interval > 1 ? "s" : "")+')');
+            Logging.info("Message notifier active (checks every "+interval+" minute"+(interval > 1 ? "s" : "")+')');
         }
     }
@@ -110,5 +111,5 @@
         if (isRunning()) {
             task.cancel(false);
-            Main.info("Message notifier inactive");
+            Logging.info("Message notifier inactive");
             task = null;
         }
@@ -153,5 +154,5 @@
                 }
             } catch (CredentialsAgentException e) {
-                Main.warn(e, "Unable to get credentials:");
+                Logging.log(Logging.LEVEL_WARN, "Unable to get credentials:", e);
             }
         }
Index: trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java	(revision 12620)
@@ -38,4 +38,5 @@
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -51,8 +52,8 @@
  *    reader.parseOsm();
  *    if (!reader.getMissingPrimitives().isEmpty()) {
- *        Main.info("There are missing primitives: " + reader.getMissingPrimitives());
+ *        Logging.info("There are missing primitives: " + reader.getMissingPrimitives());
  *    }
  *    if (!reader.getSkippedWays().isEmpty()) {
- *       Main.info("There are skipped ways: " + reader.getMissingPrimitives());
+ *       Logging.info("There are skipped ways: " + reader.getMissingPrimitives());
  *    }
  * </pre>
@@ -343,5 +344,5 @@
                 }
             } catch (InterruptedException | ExecutionException e) {
-                Main.error(e);
+                Logging.error(e);
             }
         }
@@ -487,5 +488,5 @@
             } catch (OsmApiException e) {
                 if (e.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
-                    Main.info(tr("Server replied with response code 404, retrying with an individual request for each object."));
+                    Logging.info(tr("Server replied with response code 404, retrying with an individual request for each object."));
                     return singleGetIdPackage(type, pkg, progressMonitor);
                 } else {
@@ -524,5 +525,5 @@
                 }
             } catch (IOException ex) {
-                Main.warn(ex);
+                Logging.warn(ex);
             }
             return result;
@@ -552,5 +553,5 @@
                 }
             } catch (IOException ex) {
-                Main.warn(ex);
+                Logging.warn(ex);
             }
             return result;
@@ -591,5 +592,5 @@
                 } catch (OsmApiException e) {
                     if (e.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
-                        Main.info(tr("Server replied with response code 404 for id {0}. Skipping.", Long.toString(id)));
+                        Logging.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/NameFinder.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/NameFinder.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/NameFinder.java	(revision 12620)
@@ -13,5 +13,4 @@
 import javax.xml.parsers.ParserConfigurationException;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
@@ -21,4 +20,5 @@
 import org.openstreetmap.josm.tools.HttpClient;
 import org.openstreetmap.josm.tools.HttpClient.Response;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.OsmUrlToBounds;
 import org.openstreetmap.josm.tools.UncheckedParseException;
@@ -250,8 +250,8 @@
                 }
             } catch (NumberFormatException ex) {
-                Main.error(ex); // SAXException does not chain correctly
+                Logging.error(ex); // SAXException does not chain correctly
                 throw new SAXException(ex.getMessage(), ex);
             } catch (NullPointerException ex) { // NOPMD
-                Main.error(ex); // SAXException does not chain correctly
+                Logging.error(ex); // SAXException does not chain correctly
                 throw new SAXException(tr("Null pointer exception, possibly some missing tags."), ex);
             }
Index: trunk/src/org/openstreetmap/josm/io/NoteExporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/NoteExporter.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/NoteExporter.java	(revision 12620)
@@ -9,8 +9,8 @@
 import java.io.OutputStream;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.ExtensionFileFilter;
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.gui.layer.NoteLayer;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -37,5 +37,5 @@
     @Override
     public void exportData(File file, Layer layer) throws IOException {
-        Main.info("exporting notes to file: " + file);
+        Logging.info("exporting notes to file: " + file);
         if (layer instanceof NoteLayer) {
             try (OutputStream os = new FileOutputStream(file);
Index: trunk/src/org/openstreetmap/josm/io/NoteImporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/NoteImporter.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/NoteImporter.java	(revision 12620)
@@ -14,4 +14,5 @@
 import org.openstreetmap.josm.gui.layer.NoteLayer;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
+import org.openstreetmap.josm.tools.Logging;
 import org.xml.sax.SAXException;
 
@@ -32,6 +33,6 @@
     @Override
     public void importData(final File file, ProgressMonitor progressMonitor) throws IOException {
-        if (Main.isDebugEnabled()) {
-            Main.debug("importing notes file " + file.getAbsolutePath());
+        if (Logging.isDebugEnabled()) {
+            Logging.debug("importing notes file {0}", file.getAbsolutePath());
         }
         try (InputStream is = Compression.getUncompressedFileInputStream(file)) {
@@ -41,6 +42,6 @@
             }
         } catch (SAXException e) {
-            Main.error("error opening up notes file");
-            Main.error(e, true);
+            Logging.error("error opening up notes file");
+            Logging.error(e);
             throw new IOException(e.getMessage(), e);
         }
Index: trunk/src/org/openstreetmap/josm/io/NoteReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/NoteReader.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/NoteReader.java	(revision 12620)
@@ -14,5 +14,4 @@
 import javax.xml.parsers.ParserConfigurationException;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.notes.Note;
@@ -20,4 +19,5 @@
 import org.openstreetmap.josm.data.notes.NoteComment.Action;
 import org.openstreetmap.josm.data.osm.User;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 import org.openstreetmap.josm.tools.date.DateUtils;
@@ -218,5 +218,5 @@
             Utils.parseSafeSAX(inputSource, parser);
         } catch (ParserConfigurationException e) {
-            Main.error(e); // broken SAXException chaining
+            Logging.error(e); // broken SAXException chaining
             throw new SAXException(e);
         }
Index: trunk/src/org/openstreetmap/josm/io/OsmApi.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmApi.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/OsmApi.java	(revision 12620)
@@ -37,4 +37,5 @@
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.HttpClient;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 import org.openstreetmap.josm.tools.XmlParsingException;
@@ -155,5 +156,5 @@
             host = (new URL(serverUrl)).getHost();
         } catch (MalformedURLException e) {
-            Main.warn(e);
+            Logging.warn(e);
         }
         return host;
@@ -212,5 +213,5 @@
                 initializeCapabilities(cache.updateIfRequiredString());
             } catch (SAXParseException parseException) {
-                Main.trace(parseException);
+                Logging.trace(parseException);
                 // XML parsing may fail if JOSM previously stored a corrupted capabilities document (see #8278)
                 // In that case, force update and try again
@@ -219,12 +220,12 @@
             if (capabilities == null) {
                 if (Main.isOffline(OnlineResource.OSM_API)) {
-                    Main.warn(tr("{0} not available (offline mode)", tr("OSM API")));
+                    Logging.warn(tr("{0} not available (offline mode)", tr("OSM API")));
                 } else {
-                    Main.error(tr("Unable to initialize OSM API."));
+                    Logging.error(tr("Unable to initialize OSM API."));
                 }
                 return;
             } else if (!capabilities.supportsVersion("0.6")) {
-                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}.",
+                Logging.error(tr("This version of JOSM is incompatible with the configured server."));
+                Logging.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")));
                 return;
@@ -243,5 +244,5 @@
                 for (Layer l : Main.getLayerManager().getLayersOfType(ImageryLayer.class)) {
                     if (((ImageryLayer) l).getInfo().isBlacklisted()) {
-                        Main.info(tr("Removed layer {0} because it is not allowed by the configured API.", l.getName()));
+                        Logging.info(tr("Removed layer {0} because it is not allowed by the configured API.", l.getName()));
                         Main.getLayerManager().removeLayer(l);
                     }
@@ -284,5 +285,5 @@
             osmWriter.flush();
         } catch (IOException e) {
-            Main.warn(e);
+            Logging.warn(e);
         }
         return swriter.toString();
@@ -303,5 +304,5 @@
             osmWriter.flush();
         } catch (IOException e) {
-            Main.warn(e);
+            Logging.warn(e);
         }
         return swriter.toString();
@@ -552,5 +553,5 @@
 
     private void sleepAndListen(int retry, ProgressMonitor monitor) throws OsmTransferCanceledException {
-        Main.info(tr("Waiting 10 seconds ... "));
+        Logging.info(tr("Waiting 10 seconds ... "));
         for (int i = 0; i < 10; i++) {
             if (monitor != null) {
@@ -562,9 +563,9 @@
                 Thread.sleep(1000);
             } catch (InterruptedException ex) {
-                Main.warn("InterruptedException in "+getClass().getSimpleName()+" during sleep");
+                Logging.warn("InterruptedException in "+getClass().getSimpleName()+" during sleep");
                 Thread.currentThread().interrupt();
             }
         }
-        Main.info(tr("OK - trying again."));
+        Logging.info(tr("OK - trying again."));
     }
 
@@ -652,10 +653,10 @@
 
                 final HttpClient.Response response = client.connect();
-                Main.info(response.getResponseMessage());
+                Logging.info(response.getResponseMessage());
                 int retCode = response.getResponseCode();
 
                 if (retCode >= 500 && retries-- > 0) {
                     sleepAndListen(retries, monitor);
-                    Main.info(tr("Starting retry {0} of {1}.", getMaxRetries() - retries, getMaxRetries()));
+                    Logging.info(tr("Starting retry {0} of {1}.", getMaxRetries() - retries, getMaxRetries()));
                     continue;
                 }
@@ -667,7 +668,7 @@
                 if (response.getHeaderField("Error") != null) {
                     errorHeader = response.getHeaderField("Error");
-                    Main.error("Error header: " + errorHeader);
+                    Logging.error("Error header: " + errorHeader);
                 } else if (retCode != HttpURLConnection.HTTP_OK && responseBody.length() > 0) {
-                    Main.error("Error body: " + responseBody);
+                    Logging.error("Error body: " + responseBody);
                 }
                 activeConnection.disconnect();
@@ -859,5 +860,5 @@
             throw new OsmTransferException(tr("Note upload failed"));
         } catch (SAXException | IOException e) {
-            Main.error(e, true);
+            Logging.error(e);
             throw new OsmTransferException(tr("Error parsing note response from server"), e);
         }
Index: trunk/src/org/openstreetmap/josm/io/OsmApiException.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmApiException.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/OsmApiException.java	(revision 12620)
@@ -3,5 +3,5 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -146,5 +146,5 @@
         } catch (IllegalArgumentException e) {
             // Ignored
-            Main.trace(e);
+            Logging.trace(e);
         }
         try {
@@ -157,5 +157,5 @@
         } catch (IllegalArgumentException e) {
             // Ignored
-            Main.trace(e);
+            Logging.trace(e);
         }
         return sb.toString();
Index: trunk/src/org/openstreetmap/josm/io/OsmChangeImporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmChangeImporter.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/OsmChangeImporter.java	(revision 12620)
@@ -17,4 +17,5 @@
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import org.openstreetmap.josm.gui.util.GuiHelper;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -43,5 +44,5 @@
             importData(Compression.getUncompressedFileInputStream(file), file, progressMonitor);
         } catch (FileNotFoundException e) {
-            Main.error(e);
+            Logging.error(e);
             throw new IOException(tr("File ''{0}'' does not exist.", file.getName()), e);
         }
Index: trunk/src/org/openstreetmap/josm/io/OsmChangesetContentParser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmChangesetContentParser.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/OsmChangesetContentParser.java	(revision 12620)
@@ -12,5 +12,4 @@
 import javax.xml.parsers.ParserConfigurationException;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.ChangesetDataSet;
 import org.openstreetmap.josm.data.osm.ChangesetDataSet.ChangesetModificationType;
@@ -18,4 +17,5 @@
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 import org.openstreetmap.josm.tools.XmlParsingException;
@@ -69,5 +69,5 @@
                 break;
             default:
-                Main.warn(tr("Unsupported start element ''{0}'' in changeset content at position ({1},{2}). Skipping.",
+                Logging.warn(tr("Unsupported start element ''{0}'' in changeset content at position ({1},{2}). Skipping.",
                         qName, locator.getLineNumber(), locator.getColumnNumber()));
             }
@@ -99,5 +99,5 @@
                 break;
             default:
-                Main.warn(tr("Unsupported end element ''{0}'' in changeset content at position ({1},{2}). Skipping.",
+                Logging.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 12617)
+++ trunk/src/org/openstreetmap/josm/io/OsmConnection.java	(revision 12620)
@@ -23,4 +23,5 @@
 import org.openstreetmap.josm.io.auth.CredentialsManager;
 import org.openstreetmap.josm.tools.HttpClient;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -148,5 +149,5 @@
         } else {
             String msg = tr("Unexpected value for preference ''{0}''. Got ''{1}''.", "osm-server.auth-method", authMethod);
-            Main.warn(msg);
+            Logging.warn(msg);
             throw new OsmTransferException(msg);
         }
Index: trunk/src/org/openstreetmap/josm/io/OsmExporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmExporter.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/OsmExporter.java	(revision 12620)
@@ -19,4 +19,5 @@
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -91,5 +92,5 @@
             layer.onPostSaveToFile();
         } catch (IOException e) {
-            Main.error(e);
+            Logging.error(e);
             JOptionPane.showMessageDialog(
                     Main.parent,
@@ -106,5 +107,5 @@
                 }
             } catch (IOException e2) {
-                Main.error(e2);
+                Logging.error(e2);
                 JOptionPane.showMessageDialog(
                         Main.parent,
Index: trunk/src/org/openstreetmap/josm/io/OsmHistoryReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmHistoryReader.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/OsmHistoryReader.java	(revision 12620)
@@ -11,5 +11,4 @@
 import javax.xml.parsers.ParserConfigurationException;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.history.HistoryDataSet;
 import org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive;
@@ -17,4 +16,5 @@
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 import org.xml.sax.Attributes;
@@ -94,5 +94,5 @@
             Utils.parseSafeSAX(inputSource, new Parser());
         } catch (ParserConfigurationException e) {
-            Main.error(e); // broken SAXException chaining
+            Logging.error(e); // broken SAXException chaining
             throw new SAXException(e);
         } finally {
Index: trunk/src/org/openstreetmap/josm/io/OsmImporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmImporter.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/OsmImporter.java	(revision 12620)
@@ -18,4 +18,5 @@
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import org.openstreetmap.josm.gui.util.GuiHelper;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -79,5 +80,5 @@
             importData(in, file, progressMonitor);
         } catch (FileNotFoundException e) {
-            Main.error(e);
+            Logging.error(e);
             throw new IOException(tr("File ''{0}'' does not exist.", file.getName()), e);
         }
Index: trunk/src/org/openstreetmap/josm/io/OsmReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmReader.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/OsmReader.java	(revision 12620)
@@ -21,5 +21,4 @@
 import javax.xml.stream.XMLStreamReader;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.DataSource;
@@ -43,4 +42,5 @@
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.UncheckedParseException;
 import org.openstreetmap.josm.tools.Utils;
@@ -202,5 +202,5 @@
                 Bounds copy = new Bounds(bounds);
                 bounds.normalize();
-                Main.info("Bbox " + copy + " is out of the world, normalized to " + bounds);
+                Logging.info("Bbox " + copy + " is out of the world, normalized to " + bounds);
             }
             DataSource src = new DataSource(bounds, origin);
@@ -225,5 +225,5 @@
                 nd.setCoor(ll);
             } catch (NumberFormatException e) {
-                Main.trace(e);
+                Logging.trace(e);
             }
         }
@@ -277,5 +277,5 @@
         }
         if (w.isDeleted() && !nodeIds.isEmpty()) {
-            Main.info(tr("Deleted way {0} contains nodes", w.getUniqueId()));
+            Logging.info(tr("Deleted way {0} contains nodes", w.getUniqueId()));
             nodeIds = new ArrayList<>();
         }
@@ -327,5 +327,5 @@
         }
         if (r.isDeleted() && !members.isEmpty()) {
-            Main.info(tr("Deleted relation {0} contains members", r.getUniqueId()));
+            Logging.info(tr("Deleted relation {0} contains members", r.getUniqueId()));
             members = new ArrayList<>();
         }
@@ -410,7 +410,7 @@
         if (printWarning && ("note".equals(element) || "meta".equals(element))) {
             // we know that Overpass API returns those elements
-            Main.debug(tr("Undefined element ''{0}'' found in input stream. Skipping.", element));
+            Logging.debug(tr("Undefined element ''{0}'' found in input stream. Skipping.", element));
         } else if (printWarning) {
-            Main.info(tr("Undefined element ''{0}'' found in input stream. Skipping.", element));
+            Logging.info(tr("Undefined element ''{0}'' found in input stream. Skipping.", element));
         }
         while (true) {
@@ -505,5 +505,5 @@
                             Long.toString(current.getUniqueId()), versionString));
                 } else if (version < 0 && current.isNew()) {
-                    Main.warn(tr("Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.",
+                    Logging.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;
@@ -539,8 +539,8 @@
                 current.setChangesetId(Integer.parseInt(v));
             } catch (IllegalArgumentException e) {
-                Main.debug(e.getMessage());
+                Logging.debug(e.getMessage());
                 if (current.isNew()) {
                     // for a new primitive we just log a warning
-                    Main.info(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.",
+                    Logging.info(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.",
                             v, current.getUniqueId()));
                     current.setChangesetId(0);
@@ -551,6 +551,6 @@
             } catch (IllegalStateException e) {
                 // thrown for positive changeset id on new primitives
-                Main.debug(e);
-                Main.info(e.getMessage());
+                Logging.debug(e);
+                Logging.info(e.getMessage());
                 current.setChangesetId(0);
             }
@@ -558,5 +558,5 @@
                 if (current.isNew()) {
                     // for a new primitive we just log a warning
-                    Main.info(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.",
+                    Logging.info(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.",
                             v, current.getUniqueId()));
                     current.setChangesetId(0);
Index: trunk/src/org/openstreetmap/josm/io/OsmServerChangesetReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmServerChangesetReader.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/OsmServerChangesetReader.java	(revision 12620)
@@ -13,5 +13,4 @@
 import java.util.List;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.Changeset;
 import org.openstreetmap.josm.data.osm.ChangesetDataSet;
@@ -20,4 +19,5 @@
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.XmlParsingException;
 
@@ -69,5 +69,5 @@
                 result = OsmChangesetParser.parse(in, monitor.createSubTaskMonitor(1, true));
             } catch (IOException e) {
-                Main.warn(e);
+                Logging.warn(e);
             }
         } catch (OsmTransferException e) {
@@ -110,5 +110,5 @@
                 result = changesets.get(0);
             } catch (IOException e) {
-                Main.warn(e);
+                Logging.warn(e);
             }
         } catch (OsmTransferException e) {
@@ -160,5 +160,5 @@
                     ret.addAll(changesets);
                 } catch (IOException e) {
-                    Main.warn(e);
+                    Logging.warn(e);
                 }
                 monitor.worked(1);
@@ -201,5 +201,5 @@
                 result = parser.parse(monitor.createSubTaskMonitor(1, true));
             } catch (IOException e) {
-                Main.warn(e);
+                Logging.warn(e);
             }
         } catch (XmlParsingException e) {
Index: trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmServerReader.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/OsmServerReader.java	(revision 12620)
@@ -21,4 +21,5 @@
 import org.openstreetmap.josm.io.auth.CredentialsManager;
 import org.openstreetmap.josm.tools.HttpClient;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 import org.openstreetmap.josm.tools.XmlParsingException;
@@ -48,5 +49,5 @@
             doAuthenticate = OsmApi.isUsingOAuth() && CredentialsManager.getInstance().lookupOAuthAccessToken() != null;
         } catch (CredentialsAgentException e) {
-            Main.warn(e);
+            Logging.warn(e);
         }
     }
@@ -186,5 +187,5 @@
                 response = client.connect(progressMonitor);
             } catch (IOException e) {
-                Main.error(e);
+                Logging.error(e);
                 OsmTransferException ote = new OsmTransferException(
                         tr("Could not connect to the OSM server. Please check your internet connection."), e);
@@ -221,5 +222,5 @@
             return response.fetchContent();
         } catch (IOException e) {
-            Main.error(e);
+            Logging.error(e);
             return tr("Reading error text failed.");
         }
Index: trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java	(revision 12620)
@@ -19,5 +19,4 @@
 import javax.xml.stream.XMLStreamException;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.DataSource;
@@ -27,4 +26,5 @@
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import org.openstreetmap.josm.tools.HttpClient;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.UncheckedParseException;
 import org.openstreetmap.josm.tools.Utils;
@@ -168,9 +168,9 @@
                         break;
                     default:
-                        Main.warn("Unsupported syntax: " + matcher.group(1));
+                        Logging.warn("Unsupported syntax: " + matcher.group(1));
                 }
             } catch (UncheckedParseException ex) {
                 final String msg = tr("Failed to evaluate {0}", matcher.group());
-                Main.warn(ex, msg);
+                Logging.log(Logging.LEVEL_WARN, msg, ex);
                 matcher.appendReplacement(sb, "// " + msg + "\n");
             }
@@ -245,5 +245,5 @@
                     reader = readerClass.getDeclaredConstructor().newInstance();
                 } catch (ReflectiveOperationException | IllegalArgumentException | SecurityException e) {
-                    Main.error(e);
+                    Logging.error(e);
                 }
             }
Index: trunk/src/org/openstreetmap/josm/io/audio/AudioPlayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/audio/AudioPlayer.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/audio/AudioPlayer.java	(revision 12620)
@@ -7,4 +7,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.tools.JosmRuntimeException;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -210,5 +211,5 @@
             return audioPlayer;
         } catch (JosmRuntimeException | IllegalArgumentException | IllegalStateException ex) {
-            Main.error(ex);
+            Logging.error(ex);
             return null;
         }
@@ -223,5 +224,5 @@
                 pause();
             } catch (InterruptedException | IOException e) {
-                Main.warn(e);
+                Logging.warn(e);
             }
             audioPlayer.playingUrl = null;
@@ -238,6 +239,6 @@
             soundPlayer = new JavaFxMediaPlayer();
         } catch (NoClassDefFoundError | InterruptedException e) {
-            Main.debug(e);
-            Main.warn("Java FX is unavailable. Falling back to Java Sound API");
+            Logging.debug(e);
+            Logging.warn("Java FX is unavailable. Falling back to Java Sound API");
             soundPlayer = new JavaSoundPlayer(leadIn, calibration);
         }
@@ -298,10 +299,10 @@
                     command.ok(stateChange);
                 } catch (AudioException | IOException | SecurityException | IllegalArgumentException startPlayingException) {
-                    Main.error(startPlayingException);
+                    Logging.error(startPlayingException);
                     command.failed(startPlayingException); // sets state
                 }
             } catch (AudioException | IOException e) {
                 state = State.NOTPLAYING;
-                Main.error(e);
+                Logging.error(e);
             }
         }
Index: trunk/src/org/openstreetmap/josm/io/audio/AudioUtil.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/audio/AudioUtil.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/audio/AudioUtil.java	(revision 12620)
@@ -16,4 +16,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -46,5 +47,5 @@
             return naturalLength / calibration;
         } catch (UnsupportedAudioFileException | IOException e) {
-            Main.debug(e);
+            Logging.debug(e);
             return 0.0;
         }
@@ -62,5 +63,5 @@
         else
             msg = tr(msg);
-        Main.error(msg);
+        Logging.error(msg);
         if (!GraphicsEnvironment.isHeadless()) {
             JOptionPane.showMessageDialog(Main.parent,
Index: trunk/src/org/openstreetmap/josm/io/audio/JavaSoundPlayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/audio/JavaSoundPlayer.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/audio/JavaSoundPlayer.java	(revision 12620)
@@ -15,8 +15,8 @@
 import javax.sound.sampled.UnsupportedAudioFileException;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.io.audio.AudioPlayer.Execute;
 import org.openstreetmap.josm.io.audio.AudioPlayer.State;
 import org.openstreetmap.josm.tools.ListenerList;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -90,5 +90,5 @@
                     if (skippedBytes == 0) {
                         // Avoid inifinite loop
-                        Main.warn("Unable to skip bytes from audio input stream");
+                        Logging.warn("Unable to skip bytes from audio input stream");
                         bytesToSkip = 0;
                     }
Index: trunk/src/org/openstreetmap/josm/io/auth/CredentialsManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/auth/CredentialsManager.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/auth/CredentialsManager.java	(revision 12620)
@@ -7,9 +7,9 @@
 import java.util.Objects;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.oauth.OAuthToken;
 import org.openstreetmap.josm.gui.JosmUserIdentityManager;
 import org.openstreetmap.josm.io.OsmApi;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -104,5 +104,5 @@
             }
         } catch (CredentialsAgentException ex) {
-            Main.debug(ex);
+            Logging.debug(ex);
             return null;
         }
Index: trunk/src/org/openstreetmap/josm/io/auth/DefaultAuthenticator.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/auth/DefaultAuthenticator.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/auth/DefaultAuthenticator.java	(revision 12620)
@@ -8,6 +8,6 @@
 import java.util.Objects;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.io.OsmApi;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Pair;
 
@@ -65,5 +65,5 @@
             return new PasswordAuthentication(response.getUsername(), response.getPassword());
         } catch (CredentialsAgentException e) {
-            Main.error(e);
+            Logging.error(e);
             return null;
         }
Index: trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java	(revision 12620)
@@ -15,5 +15,4 @@
 import javax.xml.parsers.ParserConfigurationException;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryBounds;
@@ -24,4 +23,5 @@
 import org.openstreetmap.josm.tools.JosmRuntimeException;
 import org.openstreetmap.josm.tools.LanguageInfo;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.MultiMap;
 import org.openstreetmap.josm.tools.Utils;
@@ -97,5 +97,5 @@
             throw e;
         } catch (ParserConfigurationException e) {
-            Main.error(e); // broken SAXException chaining
+            Logging.error(e); // broken SAXException chaining
             throw new SAXException(e);
         }
@@ -219,5 +219,5 @@
                                         atts.getValue("max-lon"), ",");
                     } catch (IllegalArgumentException e) {
-                        Main.trace(e);
+                        Logging.trace(e);
                         break;
                     }
@@ -252,5 +252,5 @@
                         shape.addPoint(atts.getValue("lat"), atts.getValue("lon"));
                     } catch (IllegalArgumentException e) {
-                        Main.trace(e);
+                        Logging.trace(e);
                         break;
                     }
Index: trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java	(revision 12620)
@@ -25,5 +25,4 @@
 import javax.xml.parsers.ParserConfigurationException;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
@@ -31,4 +30,5 @@
 import org.openstreetmap.josm.tools.HttpClient;
 import org.openstreetmap.josm.tools.HttpClient.Response;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 import org.w3c.dom.Document;
@@ -223,5 +223,5 @@
             serviceUrl = new URL(serviceUrlStr);
         } catch (HeadlessException e) {
-            Main.warn(e);
+            Logging.warn(e);
             return;
         }
@@ -229,6 +229,6 @@
         final Response response = HttpClient.create(getCapabilitiesUrl).connect();
         final String incomingData = response.fetchContent();
-        Main.debug("Server response to Capabilities request:");
-        Main.debug(incomingData);
+        Logging.debug("Server response to Capabilities request:");
+        Logging.debug(incomingData);
 
         if (response.getResponseCode() >= 400) {
@@ -239,5 +239,5 @@
             DocumentBuilder builder = Utils.newSafeDOMBuilder();
             builder.setEntityResolver((publicId, systemId) -> {
-                Main.info("Ignoring DTD " + publicId + ", " + systemId);
+                Logging.info("Ignoring DTD " + publicId + ", " + systemId);
                 return new InputSource(new StringReader(""));
             });
@@ -267,5 +267,5 @@
                 String baseURL = child.getAttribute("xlink:href");
                 if (!baseURL.equals(serviceUrlStr)) {
-                    Main.info("GetCapabilities specifies a different service URL: " + baseURL);
+                    Logging.info("GetCapabilities specifies a different service URL: " + baseURL);
                     serviceUrl = new URL(baseURL);
                 }
@@ -283,5 +283,5 @@
         boolean isFormatSupported = isImageFormatSupported(format);
         if (!isFormatSupported) {
-            Main.info("Skipping unsupported image format {0}", format);
+            Logging.info("Skipping unsupported image format {0}", format);
         }
         return isFormatSupported;
Index: trunk/src/org/openstreetmap/josm/io/nmea/NmeaReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/nmea/NmeaReader.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/nmea/NmeaReader.java	(revision 12620)
@@ -16,5 +16,4 @@
 import java.util.Optional;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.gpx.GpxConstants;
@@ -23,4 +22,5 @@
 import org.openstreetmap.josm.data.gpx.WayPoint;
 import org.openstreetmap.josm.io.IllegalDataException;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.date.DateUtils;
 
@@ -209,5 +209,5 @@
 
         } catch (IllegalDataException e) {
-            Main.warn(e);
+            Logging.warn(e);
         }
     }
@@ -480,7 +480,7 @@
         } catch (IllegalArgumentException | IndexOutOfBoundsException | IllegalDataException ex) {
             if (ps.malformed < 5) {
-                Main.warn(ex);
+                Logging.warn(ex);
             } else {
-                Main.debug(ex);
+                Logging.debug(ex);
             }
             ps.malformed++;
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java	(revision 12620)
@@ -10,4 +10,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -37,6 +38,6 @@
             instance4.start();
         } catch (IOException ex) {
-            Main.debug(ex);
-            Main.warn(marktr("Cannot start IPv4 remotecontrol server on port {0}: {1}"),
+            Logging.debug(ex);
+            Logging.warn(marktr("Cannot start IPv4 remotecontrol server on port {0}: {1}"),
                     Integer.toString(port), ex.getLocalizedMessage());
         }
@@ -47,6 +48,6 @@
             /* only show error when we also have no IPv4 */
             if (instance4 == null) {
-                Main.debug(ex);
-                Main.warn(marktr("Cannot start IPv6 remotecontrol server on port {0}: {1}"),
+                Logging.debug(ex);
+                Logging.warn(marktr("Cannot start IPv6 remotecontrol server on port {0}: {1}"),
                     Integer.toString(port), ex.getLocalizedMessage());
             }
@@ -63,5 +64,5 @@
                 instance4.stopServer();
             } catch (IOException ioe) {
-                Main.error(ioe);
+                Logging.error(ioe);
             }
             instance4 = null;
@@ -71,5 +72,5 @@
                 instance6.stopServer();
             } catch (IOException ioe) {
-                Main.error(ioe);
+                Logging.error(ioe);
             }
             instance6 = null;
@@ -96,5 +97,5 @@
     @Override
     public void run() {
-        Main.info(marktr("RemoteControl::Accepting remote connections on {0}:{1}"),
+        Logging.info(marktr("RemoteControl::Accepting remote connections on {0}:{1}"),
                 server.getInetAddress(), Integer.toString(server.getLocalPort()));
         while (true) {
@@ -105,5 +106,5 @@
             } catch (SocketException e) {
                 if (!server.isClosed()) {
-                    Main.error(e);
+                    Logging.error(e);
                 } else {
                     // stop the thread automatically if server is stopped
@@ -111,5 +112,5 @@
                 }
             } catch (IOException ioe) {
-                Main.error(ioe);
+                Logging.error(ioe);
             }
         }
@@ -122,5 +123,5 @@
      */
     public void stopServer() throws IOException {
-        Main.info(marktr("RemoteControl::Server {0}:{1} stopped."),
+        Logging.info(marktr("RemoteControl::Server {0}:{1} stopped."),
         server.getInetAddress(), Integer.toString(server.getLocalPort()));
         server.close();
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java	(revision 12620)
@@ -41,4 +41,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.preferences.StringProperty;
+import org.openstreetmap.josm.tools.Logging;
 
 import sun.security.util.ObjectIdentifier;
@@ -208,5 +209,5 @@
 
         if (!path.toFile().exists()) {
-            Main.debug("No keystore found, creating a new one");
+            Logging.debug("No keystore found, creating a new one");
 
             // Create new keystore like previous one generated with JDK keytool as follows:
@@ -252,7 +253,7 @@
             ks.load(in, KEYSTORE_PASSWORD.get().toCharArray());
 
-            if (Main.isDebugEnabled()) {
+            if (Logging.isDebugEnabled()) {
                 for (Enumeration<String> aliases = ks.aliases(); aliases.hasMoreElements();) {
-                    Main.debug("Alias in JOSM keystore: "+aliases.nextElement());
+                    Logging.debug("Alias in JOSM keystore: {0}", aliases.nextElement());
                 }
             }
@@ -278,7 +279,7 @@
         sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
 
-        if (Main.isTraceEnabled()) {
-            Main.trace("SSL Context protocol: " + sslContext.getProtocol());
-            Main.trace("SSL Context provider: " + sslContext.getProvider());
+        if (Logging.isTraceEnabled()) {
+            Logging.trace("SSL Context protocol: {0}", sslContext.getProtocol());
+            Logging.trace("SSL Context provider: {0}", sslContext.getProvider());
         }
 
@@ -316,6 +317,6 @@
                 instance4.start();
             } catch (IOException | GeneralSecurityException ex) {
-                Main.debug(ex);
-                Main.warn(marktr("Cannot start IPv4 remotecontrol https server on port {0}: {1}"),
+                Logging.debug(ex);
+                Logging.warn(marktr("Cannot start IPv4 remotecontrol https server on port {0}: {1}"),
                         Integer.toString(port), ex.getLocalizedMessage());
             }
@@ -326,6 +327,6 @@
                 /* only show error when we also have no IPv4 */
                 if (instance4 == null) {
-                    Main.debug(ex);
-                    Main.warn(marktr("Cannot start IPv6 remotecontrol https server on port {0}: {1}"),
+                    Logging.debug(ex);
+                    Logging.warn(marktr("Cannot start IPv6 remotecontrol https server on port {0}: {1}"),
                         Integer.toString(port), ex.getLocalizedMessage());
                 }
@@ -342,5 +343,5 @@
                 instance4.stopServer();
             } catch (IOException ioe) {
-                Main.error(ioe);
+                Logging.error(ioe);
             }
             instance4 = null;
@@ -350,5 +351,5 @@
                 instance6.stopServer();
             } catch (IOException ioe) {
-                Main.error(ioe);
+                Logging.error(ioe);
             }
             instance6 = null;
@@ -372,6 +373,6 @@
         // Create SSL Server factory
         SSLServerSocketFactory factory = sslContext.getServerSocketFactory();
-        if (Main.isTraceEnabled()) {
-            Main.trace("SSL factory - Supported Cipher suites: "+Arrays.toString(factory.getSupportedCipherSuites()));
+        if (Logging.isTraceEnabled()) {
+            Logging.trace("SSL factory - Supported Cipher suites: {0}", Arrays.toString(factory.getSupportedCipherSuites()));
         }
 
@@ -379,12 +380,12 @@
             RemoteControl.getInet6Address() : RemoteControl.getInet4Address());
 
-        if (Main.isTraceEnabled() && server instanceof SSLServerSocket) {
+        if (Logging.isTraceEnabled() && server instanceof SSLServerSocket) {
             SSLServerSocket sslServer = (SSLServerSocket) server;
-            Main.trace("SSL server - Enabled Cipher suites: "+Arrays.toString(sslServer.getEnabledCipherSuites()));
-            Main.trace("SSL server - Enabled Protocols: "+Arrays.toString(sslServer.getEnabledProtocols()));
-            Main.trace("SSL server - Enable Session Creation: "+sslServer.getEnableSessionCreation());
-            Main.trace("SSL server - Need Client Auth: "+sslServer.getNeedClientAuth());
-            Main.trace("SSL server - Want Client Auth: "+sslServer.getWantClientAuth());
-            Main.trace("SSL server - Use Client Mode: "+sslServer.getUseClientMode());
+            Logging.trace("SSL server - Enabled Cipher suites: {0}", Arrays.toString(sslServer.getEnabledCipherSuites()));
+            Logging.trace("SSL server - Enabled Protocols: {0}", Arrays.toString(sslServer.getEnabledProtocols()));
+            Logging.trace("SSL server - Enable Session Creation: {0}", sslServer.getEnableSessionCreation());
+            Logging.trace("SSL server - Need Client Auth: {0}", sslServer.getNeedClientAuth());
+            Logging.trace("SSL server - Want Client Auth: {0}", sslServer.getWantClientAuth());
+            Logging.trace("SSL server - Use Client Mode: {0}", sslServer.getUseClientMode());
         }
     }
@@ -395,5 +396,5 @@
     @Override
     public void run() {
-        Main.info(marktr("RemoteControl::Accepting secure remote connections on {0}:{1}"),
+        Logging.info(marktr("RemoteControl::Accepting secure remote connections on {0}:{1}"),
                 server.getInetAddress(), Integer.toString(server.getLocalPort()));
         while (true) {
@@ -401,21 +402,21 @@
                 @SuppressWarnings("resource")
                 Socket request = server.accept();
-                if (Main.isTraceEnabled() && request instanceof SSLSocket) {
+                if (Logging.isTraceEnabled() && request instanceof SSLSocket) {
                     SSLSocket sslSocket = (SSLSocket) request;
-                    Main.trace("SSL socket - Enabled Cipher suites: "+Arrays.toString(sslSocket.getEnabledCipherSuites()));
-                    Main.trace("SSL socket - Enabled Protocols: "+Arrays.toString(sslSocket.getEnabledProtocols()));
-                    Main.trace("SSL socket - Enable Session Creation: "+sslSocket.getEnableSessionCreation());
-                    Main.trace("SSL socket - Need Client Auth: "+sslSocket.getNeedClientAuth());
-                    Main.trace("SSL socket - Want Client Auth: "+sslSocket.getWantClientAuth());
-                    Main.trace("SSL socket - Use Client Mode: "+sslSocket.getUseClientMode());
-                    Main.trace("SSL socket - Session: "+sslSocket.getSession());
+                    Logging.trace("SSL socket - Enabled Cipher suites: {0}", Arrays.toString(sslSocket.getEnabledCipherSuites()));
+                    Logging.trace("SSL socket - Enabled Protocols: {0}", Arrays.toString(sslSocket.getEnabledProtocols()));
+                    Logging.trace("SSL socket - Enable Session Creation: {0}", sslSocket.getEnableSessionCreation());
+                    Logging.trace("SSL socket - Need Client Auth: {0}", sslSocket.getNeedClientAuth());
+                    Logging.trace("SSL socket - Want Client Auth: {0}", sslSocket.getWantClientAuth());
+                    Logging.trace("SSL socket - Use Client Mode: {0}", sslSocket.getUseClientMode());
+                    Logging.trace("SSL socket - Session: {0}", sslSocket.getSession());
                 }
                 RequestProcessor.processRequest(request);
             } catch (SocketException e) {
                 if (!server.isClosed()) {
-                    Main.error(e);
+                    Logging.error(e);
                 }
             } catch (IOException ioe) {
-                Main.error(ioe);
+                Logging.error(ioe);
             }
         }
@@ -428,5 +429,5 @@
      */
     public void stopServer() throws IOException {
-        Main.info(marktr("RemoteControl::Server {0}:{1} stopped."),
+        Logging.info(marktr("RemoteControl::Server {0}:{1} stopped."),
         server.getInetAddress(), Integer.toString(server.getLocalPort()));
         server.close();
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java	(revision 12620)
@@ -25,5 +25,4 @@
 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;
@@ -41,4 +40,5 @@
 import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerForbiddenException;
 import org.openstreetmap.josm.io.remotecontrol.handler.VersionHandler;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -119,9 +119,9 @@
         String commandWithSlash = '/' + command;
         if (handlers.get(commandWithSlash) != null) {
-            Main.info("RemoteControl: ignoring duplicate command " + command
+            Logging.info("RemoteControl: ignoring duplicate command " + command
                     + " with handler " + handler.getName());
         } else {
             if (!silent) {
-                Main.info("RemoteControl: adding command \"" +
+                Logging.info("RemoteControl: adding command \"" +
                     command + "\" (handled by " + handler.getSimpleName() + ')');
             }
@@ -161,5 +161,5 @@
                 return;
             }
-            Main.info("RemoteControl received: " + get);
+            Logging.info("RemoteControl received: " + get);
 
             StringTokenizer st = new StringTokenizer(get);
@@ -247,11 +247,11 @@
                     out.flush();
                 } catch (RequestHandlerErrorException ex) {
-                    Main.debug(ex);
+                    Logging.debug(ex);
                     sendError(out);
                 } catch (RequestHandlerBadRequestException ex) {
-                    Main.debug(ex);
+                    Logging.debug(ex);
                     sendBadRequest(out, ex.getMessage());
                 } catch (RequestHandlerForbiddenException ex) {
-                    Main.debug(ex);
+                    Logging.debug(ex);
                     sendForbidden(out, ex.getMessage());
                 }
@@ -259,11 +259,11 @@
 
         } catch (IOException ioe) {
-            Main.debug(Main.getErrorMessage(ioe));
+            Logging.debug(Logging.getErrorMessage(ioe));
         } catch (ReflectiveOperationException e) {
-            Main.error(e);
+            Logging.error(e);
             try {
                 sendError(out);
             } catch (IOException e1) {
-                Main.warn(e1);
+                Logging.warn(e1);
             }
         } finally {
@@ -271,5 +271,5 @@
                 request.close();
             } catch (IOException e) {
-                Main.debug(Main.getErrorMessage(e));
+                Logging.debug(Logging.getErrorMessage(e));
             }
         }
@@ -402,5 +402,5 @@
                 handler = handlers.get(cmd).getConstructor().newInstance();
             } catch (ReflectiveOperationException ex) {
-                Main.error(ex);
+                Logging.error(ex);
                 return null;
             }
@@ -410,5 +410,5 @@
             return w.toString();
         } catch (IOException e) {
-            Main.error(e);
+            Logging.error(e);
             return null;
         }
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandler.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandler.java	(revision 12620)
@@ -17,4 +17,5 @@
 import org.openstreetmap.josm.io.remotecontrol.AddTagsDialog;
 import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -77,5 +78,5 @@
 
         // Parse the arguments
-        Main.info("Adding node at (" + lat + ", " + lon + ')');
+        Logging.info("Adding node at (" + lat + ", " + lon + ')');
 
         // Create a new node
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/FeaturesHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/FeaturesHandler.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/FeaturesHandler.java	(revision 12620)
@@ -4,7 +4,7 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;
 import org.openstreetmap.josm.io.remotecontrol.RequestProcessor;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -37,5 +37,5 @@
                    buf.append(info);
                } else {
-                   Main.warn("Unknown handler {0} passed to /features request", s);
+                   Logging.warn("Unknown handler {0} passed to /features request", s);
                }
             }
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandler.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandler.java	(revision 12620)
@@ -13,4 +13,5 @@
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -77,5 +78,5 @@
                 imgInfo.setDefaultMinZoom(Integer.parseInt(minZoom));
             } catch (NumberFormatException e) {
-                Main.error(e);
+                Logging.error(e);
             }
         }
@@ -85,5 +86,5 @@
                 imgInfo.setDefaultMaxZoom(Integer.parseInt(maxZoom));
             } catch (NumberFormatException e) {
-                Main.error(e);
+                Logging.error(e);
             }
         }
@@ -97,5 +98,5 @@
             for (ImageryLayer layer : Main.getLayerManager().getLayersOfType(ImageryLayer.class)) {
                 if (layer.getInfo().equals(imgInfo)) {
-                    Main.info("Imagery layer already exists: "+imgInfo);
+                    Logging.info("Imagery layer already exists: "+imgInfo);
                     return;
                 }
@@ -106,5 +107,5 @@
                 Main.getLayerManager().addLayer(ImageryLayer.create(imgInfo));
             } catch (IllegalArgumentException e) {
-                Main.error(e, false);
+                Logging.log(Logging.LEVEL_ERROR, e);
             }
         });
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java	(revision 12620)
@@ -14,4 +14,5 @@
 import org.openstreetmap.josm.actions.downloadtasks.DownloadTask;
 import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -36,5 +37,5 @@
                 // For compatibility reasons with older instances of JOSM, arbitrary choice of DownloadOsmTask
                 // As of 2015-04, Overpass Turbo requires this branch of code ...
-                Main.debug("Remote control, /import: defaulting to DownloadOsmTask");
+                Logging.debug("Remote control, /import: defaulting to DownloadOsmTask");
                 new DownloadOsmTask().loadUrl(isLoadInNewLayer(), url.toExternalForm(), null);
             } else if (Main.pref.getBoolean("remotecontrol.import.interactive", true)) {
@@ -48,6 +49,6 @@
             }
         } catch (RuntimeException ex) { // NOPMD
-            Main.warn("RemoteControl: Error parsing import remote control request:");
-            Main.error(ex);
+            Logging.warn("RemoteControl: Error parsing import remote control request:");
+            Logging.error(ex);
             throw new RequestHandlerErrorException(ex);
         }
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java	(revision 12620)
@@ -29,4 +29,5 @@
 import org.openstreetmap.josm.io.remotecontrol.AddTagsDialog;
 import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.SubclassFilteredCollection;
 import org.openstreetmap.josm.tools.Utils;
@@ -114,5 +115,5 @@
             if (command.equals(myCommand)) {
                 if (!PermissionPrefWithDefault.LOAD_DATA.isAllowed()) {
-                    Main.info("RemoteControl: download forbidden by preferences");
+                    Logging.info("RemoteControl: download forbidden by preferences");
                 } else {
                     Area toDownload = null;
@@ -138,5 +139,5 @@
                     }
                     if (toDownload != null && toDownload.isEmpty()) {
-                        Main.info("RemoteControl: no download necessary");
+                        Logging.info("RemoteControl: no download necessary");
                     } else {
                         Future<?> future = osmTask.download(newLayer, new Bounds(minlat, minlon, maxlat, maxlon),
@@ -147,6 +148,6 @@
             }
         } catch (RuntimeException ex) { // NOPMD
-            Main.warn("RemoteControl: Error parsing load_and_zoom remote control request:");
-            Main.error(ex);
+            Logging.warn("RemoteControl: Error parsing load_and_zoom remote control request:");
+            Logging.error(ex);
             throw new RequestHandlerErrorException(ex);
         }
@@ -200,5 +201,5 @@
                 });
             } catch (SearchCompiler.ParseError ex) {
-                Main.error(ex);
+                Logging.error(ex);
                 throw new RequestHandlerErrorException(ex);
             }
@@ -284,5 +285,5 @@
                         toSelect.add(SimplePrimitiveId.fromString(item));
                     } catch (IllegalArgumentException ex) {
-                        Main.warn(ex, "RemoteControl: invalid selection '" + item + "' ignored");
+                        Logging.log(Logging.LEVEL_WARN, "RemoteControl: invalid selection '" + item + "' ignored", ex);
                     }
                 }
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandler.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandler.java	(revision 12620)
@@ -18,4 +18,5 @@
 import org.openstreetmap.josm.io.remotecontrol.AddTagsDialog;
 import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -59,5 +60,5 @@
     protected void handleRequest() throws RequestHandlerErrorException, RequestHandlerBadRequestException {
         if (!PermissionPrefWithDefault.LOAD_DATA.isAllowed()) {
-            Main.info("RemoteControl: download forbidden by preferences");
+            Logging.info("RemoteControl: download forbidden by preferences");
         }
         if (!ps.isEmpty()) {
@@ -102,5 +103,5 @@
                     ps.add(SimplePrimitiveId.fromString(i));
                 } catch (IllegalArgumentException e) {
-                    Main.warn(e, "RemoteControl: invalid selection '"+i+"' ignored.");
+                    Logging.log(Logging.LEVEL_WARN, "RemoteControl: invalid selection '"+i+"' ignored.", e);
                 }
             }
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java	(revision 12620)
@@ -20,4 +20,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -148,5 +149,5 @@
         if (permissionPref != null && permissionPref.pref != null && !Main.pref.getBoolean(permissionPref.pref, permissionPref.defaultVal)) {
             String err = MessageFormat.format("RemoteControl: ''{0}'' forbidden by preferences", myCommand);
-            Main.info(err);
+            Logging.info(err);
             throw new RequestHandlerForbiddenException(err);
         }
@@ -228,5 +229,5 @@
                 if (value == null || value.isEmpty()) {
                     error = true;
-                    Main.warn('\'' + myCommand + "' remote control request must have '" + key + "' parameter");
+                    Logging.warn('\'' + myCommand + "' remote control request must have '" + key + "' parameter");
                     missingKeys.add(key);
                 }
@@ -241,5 +242,5 @@
             for (String par: args.keySet()) {
                 if (!knownParams.contains(par)) {
-                    Main.warn("Unknown remote control parameter {0}, skipping it", par);
+                    Logging.warn("Unknown remote control parameter {0}, skipping it", par);
                 }
             }
Index: trunk/src/org/openstreetmap/josm/io/session/GeoImageSessionExporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/session/GeoImageSessionExporter.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/session/GeoImageSessionExporter.java	(revision 12620)
@@ -12,9 +12,9 @@
 import javax.swing.SwingConstants;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.gui.layer.geoimage.GeoImageLayer;
 import org.openstreetmap.josm.gui.layer.geoimage.ImageEntry;
 import org.openstreetmap.josm.tools.GBC;
+import org.openstreetmap.josm.tools.Logging;
 import org.w3c.dom.Element;
 
@@ -66,5 +66,5 @@
 
             if (entry.getFile() == null) {
-                Main.warn("No file attribute for image - skipping entry");
+                Logging.warn("No file attribute for image - skipping entry");
                 break;
             }
Index: trunk/src/org/openstreetmap/josm/io/session/GeoImageSessionImporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/session/GeoImageSessionImporter.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/session/GeoImageSessionImporter.java	(revision 12620)
@@ -10,5 +10,4 @@
 import java.util.List;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.gui.layer.GpxLayer;
@@ -18,4 +17,5 @@
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import org.openstreetmap.josm.io.IllegalDataException;
+import org.openstreetmap.josm.tools.Logging;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -117,5 +117,5 @@
             // TODO: handle thumbnail loading
         } catch (NumberFormatException e) {
-            Main.trace(e);
+            Logging.trace(e);
         }
     }
Index: trunk/src/org/openstreetmap/josm/io/session/ImagerySessionImporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/session/ImagerySessionImporter.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/session/ImagerySessionImporter.java	(revision 12620)
@@ -8,5 +8,4 @@
 import java.util.Map;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Preferences;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
@@ -23,4 +22,5 @@
 import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.io.session.SessionReader.ImportSupport;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 import org.w3c.dom.Element;
@@ -50,11 +50,11 @@
                 String zoomStr = attributes.get("zoom-level");
                 if (zoomStr != null) {
-                        support.addPostLayersTask(() -> {
-                            try {
-                                tsLayer.setZoomLevel(Integer.parseInt(zoomStr));
-                            } catch (NumberFormatException e) {
-                                Main.warn(e);
-                            }
-                        });
+                    support.addPostLayersTask(() -> {
+                        try {
+                            tsLayer.setZoomLevel(Integer.parseInt(zoomStr));
+                        } catch (NumberFormatException e) {
+                            Logging.warn(e);
+                        }
+                    });
                 }
             }
Index: trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/session/SessionReader.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/session/SessionReader.java	(revision 12620)
@@ -45,4 +45,5 @@
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.JosmRuntimeException;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.MultiMap;
 import org.openstreetmap.josm.tools.Utils;
@@ -447,5 +448,5 @@
             active = !activeAtt.isEmpty() ? (Integer.parseInt(activeAtt)-1) : -1;
         } catch (NumberFormatException e) {
-            Main.warn("Unsupported value for 'active' layer attribute. Ignoring it. Error was: "+e.getMessage());
+            Logging.warn("Unsupported value for 'active' layer attribute. Ignoring it. Error was: "+e.getMessage());
             active = -1;
         }
@@ -468,5 +469,5 @@
                         idx = Integer.valueOf(e.getAttribute("index"));
                     } catch (NumberFormatException ex) {
-                        Main.warn(ex);
+                        Logging.warn(ex);
                     }
                     if (idx == null) {
@@ -485,5 +486,5 @@
                                 d = Integer.valueOf(sd);
                             } catch (NumberFormatException ex) {
-                                Main.warn(ex);
+                                Logging.warn(ex);
                             }
                             if (d != null) {
@@ -567,5 +568,5 @@
                 }
                 if (exception != null) {
-                    Main.error(exception);
+                    Logging.error(exception);
                     if (!GraphicsEnvironment.isHeadless()) {
                         CancelOrContinueDialog dialog = new CancelOrContinueDialog();
@@ -607,5 +608,5 @@
                     layer.setOpacity(opacity);
                 } catch (NumberFormatException ex) {
-                    Main.warn(ex);
+                    Logging.warn(ex);
                 }
             }
@@ -625,5 +626,5 @@
                     Double.parseDouble(centerEl.getAttribute("lon")));
         } catch (NumberFormatException ex) {
-            Main.warn(ex);
+            Logging.warn(ex);
         }
         if (center == null) return null;
@@ -634,5 +635,5 @@
             return new SessionViewportData(center, scale);
         } catch (NumberFormatException ex) {
-            Main.warn(ex);
+            Logging.warn(ex);
             return null;
         }
Index: trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java	(revision 12617)
+++ trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java	(revision 12620)
@@ -43,4 +43,5 @@
 import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference;
 import org.openstreetmap.josm.tools.JosmRuntimeException;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.MultiMap;
 import org.openstreetmap.josm.tools.Utils;
@@ -241,5 +242,5 @@
                     int depIndex = layers.indexOf(depLayer);
                     if (depIndex == -1) {
-                        Main.warn("Unable to find " + depLayer);
+                        Logging.warn("Unable to find " + depLayer);
                     } else {
                         depsInt.add(depIndex+1);
