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/data/imagery/WmsCache.java

    r6093 r6248  
    123123                layersIndex.load(fis);
    124124            } catch (FileNotFoundException e) {
    125                 System.out.println("Unable to load layers index for wms cache (file " + layerIndexFile + " not found)");
     125                Main.error("Unable to load layers index for wms cache (file " + layerIndexFile + " not found)");
    126126            } catch (IOException e) {
    127                 System.err.println("Unable to load layers index for wms cache");
     127                Main.error("Unable to load layers index for wms cache");
    128128                e.printStackTrace();
    129129            }
     
    151151                    layersIndex.store(fos, "");
    152152                } catch (IOException e) {
    153                     System.err.println("Unable to save layer index for wms cache");
     153                    Main.error("Unable to save layer index for wms cache");
    154154                    e.printStackTrace();
    155155                }
     
    187187            totalFileSize = cacheEntries.getTotalFileSize();
    188188            if (cacheEntries.getTileSize() != tileSize) {
    189                 System.out.println("Cache created with different tileSize, cache will be discarded");
     189                Main.info("Cache created with different tileSize, cache will be discarded");
    190190                return;
    191191            }
     
    202202            if (indexFile.exists()) {
    203203                e.printStackTrace();
    204                 System.out.println("Unable to load index for wms-cache, new file will be created");
     204                Main.info("Unable to load index for wms-cache, new file will be created");
    205205            } else {
    206                 System.out.println("Index for wms-cache doesn't exist, new file will be created");
     206                Main.info("Index for wms-cache doesn't exist, new file will be created");
    207207            }
    208208        }
     
    297297            marshaller.marshal(index, new FileOutputStream(new File(cacheDir, INDEX_FILENAME)));
    298298        } catch (Exception e) {
    299             System.err.println("Failed to save wms-cache file");
     299            Main.error("Failed to save wms-cache file");
    300300            e.printStackTrace();
    301301        }
     
    364364                return loadImage(projectionEntries, entry);
    365365            } catch (IOException e) {
    366                 System.err.println("Unable to load file from wms cache");
     366                Main.error("Unable to load file from wms cache");
    367367                e.printStackTrace();
    368368                return null;
Note: See TracChangeset for help on using the changeset viewer.