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

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

Location:
trunk/src/org/openstreetmap/josm/data/cache
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/cache/CacheEntryAttributes.java

    r12279 r12620  
    1111
    1212import org.apache.commons.jcs.engine.ElementAttributes;
    13 import org.openstreetmap.josm.Main;
     13import org.openstreetmap.josm.tools.Logging;
    1414
    1515/**
     
    162162        for (Entry<String, String> e: map.entrySet()) {
    163163            if (RESERVED_KEYS.contains(e.getKey())) {
    164                 Main.info("Metadata key configuration contains key {0} which is reserved for internal use");
     164                Logging.info("Metadata key configuration contains key {0} which is reserved for internal use");
    165165            } else {
    166166                attrs.put(e.getKey(), e.getValue());
     
    191191     */
    192192    public void setError(Exception error) {
    193         setErrorMessage(Main.getErrorMessage(error));
     193        setErrorMessage(Logging.getErrorMessage(error));
    194194    }
    195195
  • trunk/src/org/openstreetmap/josm/data/cache/HostLimitQueue.java

    r11546 r12620  
    1212import java.util.concurrent.TimeUnit;
    1313
    14 import org.openstreetmap.josm.Main;
     14import org.openstreetmap.josm.tools.Logging;
    1515
    1616/**
     
    6767                        url = job.getUrl();
    6868                    } catch (IOException e) {
    69                         Main.debug(e);
     69                        Logging.debug(e);
    7070                    }
    71                     Main.debug("TMS - Skipping job {0} because host limit reached", url);
     71                    Logging.debug("TMS - Skipping job {0} because host limit reached", url);
    7272                }
    7373            }
     
    9090                // acquire my got interrupted, first offer back what was taken
    9191                if (!offer(job)) {
    92                     Main.warn("Unable to offer back " + job);
     92                    Logging.warn("Unable to offer back " + job);
    9393                }
    9494                throw e;
     
    110110            // acquire my got interrupted, first offer back what was taken
    111111            if (!offer(job)) {
    112                 Main.warn("Unable to offer back " + job);
     112                Logging.warn("Unable to offer back " + job);
    113113            }
    114114            throw e;
     
    209209            limit.release();
    210210            if (limit.availablePermits() > hostLimit) {
    211                 Main.warn("More permits than it should be");
     211                Logging.warn("More permits than it should be");
    212212            }
    213213        }
  • trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java

    r12537 r12620  
    3131import org.openstreetmap.josm.data.preferences.BooleanProperty;
    3232import org.openstreetmap.josm.data.preferences.IntegerProperty;
     33import org.openstreetmap.josm.tools.Logging;
    3334import org.openstreetmap.josm.tools.Utils;
    3435
     
    9192                String msg = formatter.formatMessage(record);
    9293                if (record.getLevel().intValue() >= Level.SEVERE.intValue()) {
    93                     Main.error(msg);
     94                    Logging.error(msg);
    9495                } else if (record.getLevel().intValue() >= Level.WARNING.intValue()) {
    95                     Main.warn(msg);
     96                    Logging.warn(msg);
    9697                    // downgrade INFO level to debug, as JCS is too verbose at INFO level
    9798                } else if (record.getLevel().intValue() >= Level.INFO.intValue()) {
    98                     Main.debug(msg);
     99                    Logging.debug(msg);
    99100                } else {
    100                     Main.trace(msg);
     101                    Logging.trace(msg);
    101102                }
    102103            }
  • trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java

    r12542 r12620  
    2222import org.apache.commons.jcs.engine.behavior.ICacheElement;
    2323import org.openstreetmap.gui.jmapviewer.FeatureAdapter;
    24 import org.openstreetmap.josm.Main;
    2524import org.openstreetmap.josm.data.cache.ICachedLoaderListener.LoadResult;
    2625import org.openstreetmap.josm.data.preferences.IntegerProperty;
    2726import org.openstreetmap.josm.tools.CheckParameterUtil;
    2827import org.openstreetmap.josm.tools.HttpClient;
     28import org.openstreetmap.josm.tools.Logging;
    2929import org.openstreetmap.josm.tools.Utils;
    3030
     
    216216            return getUrl().getHost();
    217217        } catch (IOException e) {
    218             Main.trace(e);
     218            Logging.trace(e);
    219219            return null;
    220220        }
     
    264264            } catch (IOException e) {
    265265                listeners = null;
    266                 Main.trace(e);
     266                Logging.trace(e);
    267267            }
    268268        }
     
    406406            attributes.setError(e);
    407407            LOG.log(Level.WARNING, "JCS - Exception during download {0}", getUrlNoException());
    408             Main.warn(e);
     408            Logging.warn(e);
    409409            Thread.currentThread().interrupt();
    410410        }
     
    446446            } catch (NumberFormatException e) {
    447447                // ignore malformed Cache-Control headers
    448                 Main.trace(e);
     448                Logging.trace(e);
    449449            }
    450450        }
Note: See TracChangeset for help on using the changeset viewer.