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/tools/ImageProvider.java

    r6246 r6248  
    308308            } else {
    309309                if (!suppressWarnings) {
    310                     System.err.println(tr("Failed to locate image ''{0}''", name));
     310                    Main.error(tr("Failed to locate image ''{0}''", name));
    311311                }
    312312                return null;
     
    613613            }
    614614        } catch (Exception e) {
    615             System.err.println(tr("Warning: failed to handle zip file ''{0}''. Exception was: {1}", archive.getName(), e.toString()));
     615            Main.warn(tr("Failed to handle zip file ''{0}''. Exception was: {1}", archive.getName(), e.toString()));
    616616        } finally {
    617617            Utils.close(zipFile);
     
    671671                        return u;
    672672                } catch (SecurityException e) {
    673                     System.out.println(tr(
    674                             "Warning: failed to access directory ''{0}'' for security reasons. Exception was: {1}",
     673                    Main.warn(tr(
     674                            "Failed to access directory ''{0}'' for security reasons. Exception was: {1}",
    675675                            name, e.toString()));
    676676                }
     
    685685                return u;
    686686        } catch (SecurityException e) {
    687             System.out.println(tr(
    688                     "Warning: failed to access directory ''{0}'' for security reasons. Exception was: {1}", dir, e
     687            Main.warn(tr(
     688                    "Failed to access directory ''{0}'' for security reasons. Exception was: {1}", dir, e
    689689                    .toString()));
    690690        }
     
    736736                @Override
    737737                public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
    738                     System.out.println();
    739738                    if (localName.equalsIgnoreCase("img")) {
    740739                        String val = atts.getValue("src");
     
    759758            return r.getResult();
    760759        } catch (Exception e) {
    761             System.out.println("INFO: parsing " + base + fn + " failed:\n" + e);
     760            Main.warn("Parsing " + base + fn + " failed:\n" + e);
    762761            return null;
    763762        }
    764         System.out.println("INFO: parsing " + base + fn + " failed: Unexpected content.");
     763        Main.warn("Parsing " + base + fn + " failed: Unexpected content.");
    765764        return null;
    766765    }
Note: See TracChangeset for help on using the changeset viewer.