Changeset 12620 in josm for trunk/src/org/openstreetmap/josm/gui/MainApplication.java
- Timestamp:
- 2017-08-22T22:26:32+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r12279 r12620 223 223 Logging.setLogLevel(logLevel); 224 224 if (!args.showVersion() && !args.showHelp()) { 225 Main.info(tr("Log level is at {0} ({1}, {2})", logLevel.getLocalizedName(), logLevel.getName(), logLevel.intValue()));225 Logging.info(tr("Log level is at {0} ({1}, {2})", logLevel.getLocalizedName(), logLevel.getName(), logLevel.intValue())); 226 226 } 227 227 … … 263 263 boolean skipLoadingPlugins = args.hasOption(Option.SKIP_PLUGINS); 264 264 if (skipLoadingPlugins) { 265 Main.info(tr("Plugin loading skipped"));265 Logging.info(tr("Plugin loading skipped")); 266 266 } 267 267 … … 269 269 // Enable debug in OAuth signpost via system preference, but only at trace level 270 270 Utils.updateSystemProperty("debug", "true"); 271 Main.info(tr("Enabled detailed debug level (trace)"));271 Logging.info(tr("Enabled detailed debug level (trace)")); 272 272 } 273 273 … … 306 306 CustomConfigurator.XMLCommandProcessor config = new CustomConfigurator.XMLCommandProcessor(Main.pref); 307 307 for (String i : args.get(Option.LOAD_PREFERENCES)) { 308 info("Reading preferences from " + i);308 Logging.info("Reading preferences from " + i); 309 309 try (InputStream is = openStream(new URL(i))) { 310 310 config.openAndReadXML(is); … … 318 318 CertificateAmendment.addMissingCertificates(); 319 319 } catch (IOException | GeneralSecurityException ex) { 320 Main.warn(ex);321 Main.warn(getErrorMessage(Utils.getRootCause(ex)));320 Logging.warn(ex); 321 Logging.warn(Logging.getErrorMessage(Utils.getRootCause(ex))); 322 322 } 323 323 Authenticator.setDefault(DefaultAuthenticator.getInstance()); … … 387 387 PlatformHookWindows.removeInsecureCertificates(); 388 388 } catch (NoSuchAlgorithmException | CertificateException | KeyStoreException | IOException e) { 389 error(e);389 Logging.error(e); 390 390 } 391 391 } … … 402 402 // Repaint manager is registered so late for a reason - there is lots of violation during startup process 403 403 // but they don't seem to break anything and are difficult to fix 404 info("Enabled EDT checker, wrongful access to gui from non EDT thread will be printed to console");404 Logging.info("Enabled EDT checker, wrongful access to gui from non EDT thread will be printed to console"); 405 405 RepaintManager.setCurrentManager(new CheckThreadViolationRepaintManager()); 406 406 } … … 443 443 Main.setOffline(OnlineResource.valueOf(s.toUpperCase(Locale.ENGLISH))); 444 444 } catch (IllegalArgumentException e) { 445 Main.error(e, tr("''{0}'' is not a valid value for argument ''{1}''. Possible values are {2}, possibly delimited by commas.", 446 s.toUpperCase(Locale.ENGLISH), Option.OFFLINE.getName(), Arrays.toString(OnlineResource.values()))); 445 Logging.log(Logging.LEVEL_ERROR, 446 tr("''{0}'' is not a valid value for argument ''{1}''. Possible values are {2}, possibly delimited by commas.", 447 s.toUpperCase(Locale.ENGLISH), Option.OFFLINE.getName(), Arrays.toString(OnlineResource.values())), e); 447 448 System.exit(1); 448 449 return; … … 452 453 Set<OnlineResource> offline = Main.getOfflineResources(); 453 454 if (!offline.isEmpty()) { 454 Main.warn(trn("JOSM is running in offline mode. This resource will not be available: {0}",455 Logging.warn(trn("JOSM is running in offline mode. This resource will not be available: {0}", 455 456 "JOSM is running in offline mode. These resources will not be available: {0}", 456 457 offline.size(), offline.size() == 1 ? offline.iterator().next() : Arrays.toString(offline.toArray()))); … … 480 481 Utils.updateSystemProperty("java.net.preferIPv6Addresses", "true"); 481 482 if (!wasv6) { 482 Main.info(tr("Detected useable IPv6 network, prefering IPv6 over IPv4 after next restart."));483 Logging.info(tr("Detected useable IPv6 network, prefering IPv6 over IPv4 after next restart.")); 483 484 } else { 484 Main.info(tr("Detected useable IPv6 network, prefering IPv6 over IPv4."));485 Logging.info(tr("Detected useable IPv6 network, prefering IPv6 over IPv4.")); 485 486 } 486 487 hasv6 = true; … … 490 491 } 491 492 } catch (IOException | SecurityException e) { 492 if (Main.isDebugEnabled()) { 493 Main.debug("Exception while checking IPv6 connectivity: "+e); 494 } 495 Main.trace(e); 493 Logging.debug("Exception while checking IPv6 connectivity: {0}", e); 494 Logging.trace(e); 496 495 } 497 496 if (wasv6 && !hasv6) { 498 Main.info(tr("Detected no useable IPv6 network, prefering IPv4 over IPv6 after next restart."));497 Logging.info(tr("Detected no useable IPv6 network, prefering IPv4 over IPv6 after next restart.")); 499 498 Main.pref.put("validated.ipv6", hasv6); // be sure it is stored before the restart! 500 499 try { 501 500 RestartAction.restartJOSM(); 502 501 } catch (IOException e) { 503 Main.error(e);502 Logging.error(e); 504 503 } 505 504 }
Note:
See TracChangeset
for help on using the changeset viewer.