Ignore:
Timestamp:
2020-03-08T09:25:04+01:00 (4 years ago)
Author:
simon04
Message:

see #18752 - Harmonize stopwatch logging

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Stopwatch.java

    r15755 r16069  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.tools;
     3
     4import static org.openstreetmap.josm.tools.I18n.tr;
    35
    46/**
     
    4446        return Utils.getDurationString(Math.max(0, elapsed()));
    4547    }
     48
     49    /**
     50     * Formats the given task name and duration since start as i18n string
     51     * @param taskName the task name
     52     * @return the task name and duration since start as i18n string
     53     */
     54    public String toString(String taskName) {
     55        return tr("{0} completed in {1}", taskName, toString());
     56    }
    4657}
  • trunk/src/org/openstreetmap/josm/tools/XmlUtils.java

    r15755 r16069  
    8787        Logging.debug("Starting DOM parsing of {0}", is);
    8888        Document result = newSafeDOMBuilder().parse(is);
    89         Logging.debug("DOM parsing done in {0}", stopwatch);
     89        Logging.debug(stopwatch.toString("DOM parsing"));
    9090        return result;
    9191    }
     
    118118        Logging.debug("Starting SAX parsing of {0} using {1}", is, dh);
    119119        newSafeSAXParser().parse(is, dh);
    120         Logging.debug("SAX parsing done in {0}", stopwatch);
     120        Logging.debug(stopwatch.toString("SAX parsing"));
    121121    }
    122122
Note: See TracChangeset for help on using the changeset viewer.