Ignore:
Timestamp:
2013-09-23T16:47:50+02:00 (11 years ago)
Author:
Don-vip
Message:

Rework console output:

  • new log level "error"
  • Replace nearly all calls to system.out and system.err to Main.(error|warn|info|debug)
  • Remove some unnecessary debug output
  • Some messages are modified (removal of "Info", "Warning", "Error" from the message itself -> notable i18n impact but limited to console error messages not seen by the majority of users, so that's ok)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/OsmApi.java

    r6070 r6248  
    229229                version = "0.6";
    230230            } else {
    231                 System.err.println(tr("This version of JOSM is incompatible with the configured server."));
    232                 System.err.println(tr("It supports protocol version 0.6, while the server says it supports {0} to {1}.",
     231                Main.error(tr("This version of JOSM is incompatible with the configured server."));
     232                Main.error(tr("It supports protocol version 0.6, while the server says it supports {0} to {1}.",
    233233                        capabilities.get("version", "minimum"), capabilities.get("version", "maximum")));
    234234                initialized = false; // FIXME gets overridden by next assignment
     
    256256                for (Layer l : Main.map.mapView.getLayersOfType(ImageryLayer.class)) {
    257257                    if (((ImageryLayer) l).getInfo().isBlacklisted()) {
    258                         System.out.println(tr("Removed layer {0} because it is not allowed by the configured API.", l.getName()));
     258                        Main.info(tr("Removed layer {0} because it is not allowed by the configured API.", l.getName()));
    259259                        Main.main.removeLayer(l);
    260260                    }
     
    548548            } catch (InterruptedException ex) {}
    549549        }
    550         System.out.println(tr("OK - trying again."));
     550        Main.info(tr("OK - trying again."));
    551551    }
    552552
     
    628628
    629629                activeConnection.connect();
    630                 System.out.println(activeConnection.getResponseMessage());
     630                Main.info(activeConnection.getResponseMessage());
    631631                int retCode = activeConnection.getResponseCode();
    632632
     
    634634                    if (retries-- > 0) {
    635635                        sleepAndListen(retries, monitor);
    636                         System.out.println(tr("Starting retry {0} of {1}.", getMaxRetries() - retries,getMaxRetries()));
     636                        Main.info(tr("Starting retry {0} of {1}.", getMaxRetries() - retries,getMaxRetries()));
    637637                        continue;
    638638                    }
     
    666666                if (activeConnection.getHeaderField("Error") != null) {
    667667                    errorHeader = activeConnection.getHeaderField("Error");
    668                     System.err.println("Error header: " + errorHeader);
     668                    Main.error("Error header: " + errorHeader);
    669669                } else if (retCode != 200 && responseBody.length()>0) {
    670                     System.err.println("Error body: " + responseBody);
     670                    Main.error("Error body: " + responseBody);
    671671                }
    672672                activeConnection.disconnect();
Note: See TracChangeset for help on using the changeset viewer.