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/MirroredInputStream.java

    r6148 r6248  
    150150            }
    151151        } catch (Exception e) {
    152             if(file.getName().endsWith(".zip")) {
    153                 System.err.println(tr("Warning: failed to open file with extension ''{2}'' and namepart ''{3}'' in zip file ''{0}''. Exception was: {1}",
     152            if (file.getName().endsWith(".zip")) {
     153                Main.warn(tr("Failed to open file with extension ''{2}'' and namepart ''{3}'' in zip file ''{0}''. Exception was: {1}",
    154154                        file.getName(), e.toString(), extension, namepart));
    155155            }
     
    257257                {Long.toString(System.currentTimeMillis()), localFile.toString()}));
    258258            } else {
    259                 System.out.println(tr("Failed to rename file {0} to {1}.",
     259                Main.warn(tr("Failed to rename file {0} to {1}.",
    260260                destDirFile.getPath(), localFile.getPath()));
    261261            }
    262262        } catch (IOException e) {
    263263            if (age >= maxTime*1000 && age < maxTime*1000*2) {
    264                 System.out.println(tr("Failed to load {0}, use cached file and retry next time: {1}",
    265                 url, e));
     264                Main.warn(tr("Failed to load {0}, use cached file and retry next time: {1}", url, e));
    266265                return localFile;
    267266            } else {
     
    319318                    throw new IOException(msg);
    320319                }
    321                 System.out.println(tr("Download redirected to ''{0}''", downloadUrl));
     320                Main.info(tr("Download redirected to ''{0}''", downloadUrl));
    322321                break;
    323322            default:
Note: See TracChangeset for help on using the changeset viewer.