Ignore:
Timestamp:
2017-08-22T22:26:32+02:00 (7 years ago)
Author:
Don-vip
Message:

see #15182 - deprecate all Main logging methods and introduce suitable replacements in Logging for most of them

File:
1 edited

Legend:

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

    r12588 r12620  
    2121import javax.xml.stream.XMLStreamReader;
    2222
    23 import org.openstreetmap.josm.Main;
    2423import org.openstreetmap.josm.data.Bounds;
    2524import org.openstreetmap.josm.data.DataSource;
     
    4342import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    4443import org.openstreetmap.josm.tools.CheckParameterUtil;
     44import org.openstreetmap.josm.tools.Logging;
    4545import org.openstreetmap.josm.tools.UncheckedParseException;
    4646import org.openstreetmap.josm.tools.Utils;
     
    202202                Bounds copy = new Bounds(bounds);
    203203                bounds.normalize();
    204                 Main.info("Bbox " + copy + " is out of the world, normalized to " + bounds);
     204                Logging.info("Bbox " + copy + " is out of the world, normalized to " + bounds);
    205205            }
    206206            DataSource src = new DataSource(bounds, origin);
     
    225225                nd.setCoor(ll);
    226226            } catch (NumberFormatException e) {
    227                 Main.trace(e);
     227                Logging.trace(e);
    228228            }
    229229        }
     
    277277        }
    278278        if (w.isDeleted() && !nodeIds.isEmpty()) {
    279             Main.info(tr("Deleted way {0} contains nodes", w.getUniqueId()));
     279            Logging.info(tr("Deleted way {0} contains nodes", w.getUniqueId()));
    280280            nodeIds = new ArrayList<>();
    281281        }
     
    327327        }
    328328        if (r.isDeleted() && !members.isEmpty()) {
    329             Main.info(tr("Deleted relation {0} contains members", r.getUniqueId()));
     329            Logging.info(tr("Deleted relation {0} contains members", r.getUniqueId()));
    330330            members = new ArrayList<>();
    331331        }
     
    410410        if (printWarning && ("note".equals(element) || "meta".equals(element))) {
    411411            // we know that Overpass API returns those elements
    412             Main.debug(tr("Undefined element ''{0}'' found in input stream. Skipping.", element));
     412            Logging.debug(tr("Undefined element ''{0}'' found in input stream. Skipping.", element));
    413413        } else if (printWarning) {
    414             Main.info(tr("Undefined element ''{0}'' found in input stream. Skipping.", element));
     414            Logging.info(tr("Undefined element ''{0}'' found in input stream. Skipping.", element));
    415415        }
    416416        while (true) {
     
    505505                            Long.toString(current.getUniqueId()), versionString));
    506506                } else if (version < 0 && current.isNew()) {
    507                     Main.warn(tr("Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.",
     507                    Logging.warn(tr("Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.",
    508508                            current.getUniqueId(), version, 0, "0.6"));
    509509                    version = 0;
     
    539539                current.setChangesetId(Integer.parseInt(v));
    540540            } catch (IllegalArgumentException e) {
    541                 Main.debug(e.getMessage());
     541                Logging.debug(e.getMessage());
    542542                if (current.isNew()) {
    543543                    // for a new primitive we just log a warning
    544                     Main.info(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.",
     544                    Logging.info(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.",
    545545                            v, current.getUniqueId()));
    546546                    current.setChangesetId(0);
     
    551551            } catch (IllegalStateException e) {
    552552                // thrown for positive changeset id on new primitives
    553                 Main.debug(e);
    554                 Main.info(e.getMessage());
     553                Logging.debug(e);
     554                Logging.info(e.getMessage());
    555555                current.setChangesetId(0);
    556556            }
     
    558558                if (current.isNew()) {
    559559                    // for a new primitive we just log a warning
    560                     Main.info(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.",
     560                    Logging.info(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.",
    561561                            v, current.getUniqueId()));
    562562                    current.setChangesetId(0);
Note: See TracChangeset for help on using the changeset viewer.