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

    r12537 r12620  
    2121import org.openstreetmap.josm.gui.preferences.server.ProxyPreferencesPanel;
    2222import org.openstreetmap.josm.gui.preferences.server.ProxyPreferencesPanel.ProxyPolicy;
     23import org.openstreetmap.josm.tools.Logging;
    2324
    2425/**
     
    9394            port = Integer.parseInt(value);
    9495        } catch (NumberFormatException e) {
    95             Main.error(tr("Unexpected format for port number in preference ''{0}''. Got ''{1}''.", property, value));
    96             Main.error(tr("The proxy will not be used."));
     96            Logging.error(tr("Unexpected format for port number in preference ''{0}''. Got ''{1}''.", property, value));
     97            Logging.error(tr("The proxy will not be used."));
    9798            return 0;
    9899        }
    99100        if (port <= 0 || port > 65_535) {
    100             Main.error(tr("Illegal port number in preference ''{0}''. Got {1}.", property, port));
    101             Main.error(tr("The proxy will not be used."));
     101            Logging.error(tr("Illegal port number in preference ''{0}''. Got {1}.", property, port));
     102            Logging.error(tr("The proxy will not be used."));
    102103            return 0;
    103104        }
     
    116117            proxyPolicy = ProxyPolicy.fromName(value);
    117118            if (proxyPolicy == null) {
    118                 Main.warn(tr("Unexpected value for preference ''{0}'' found. Got ''{1}''. Will use no proxy.",
     119                Logging.warn(tr("Unexpected value for preference ''{0}'' found. Got ''{1}''. Will use no proxy.",
    119120                        ProxyPreferencesPanel.PROXY_POLICY, value));
    120121                proxyPolicy = ProxyPolicy.NO_PROXY;
     
    128129                httpProxySocketAddress = new InetSocketAddress(host, port);
    129130            } else {
    130                 Main.warn(tr("Unexpected parameters for HTTP proxy. Got host ''{0}'' and port ''{1}''.", host, port));
    131                 Main.warn(tr("The proxy will not be used."));
     131                Logging.warn(tr("Unexpected parameters for HTTP proxy. Got host ''{0}'' and port ''{1}''.", host, port));
     132                Logging.warn(tr("The proxy will not be used."));
    132133            }
    133134        }
     
    140141                socksProxySocketAddress = new InetSocketAddress(host, port);
    141142            } else {
    142                 Main.warn(tr("Unexpected parameters for SOCKS proxy. Got host ''{0}'' and port ''{1}''.", host, port));
    143                 Main.warn(tr("The proxy will not be used."));
     143                Logging.warn(tr("Unexpected parameters for SOCKS proxy. Got host ''{0}'' and port ''{1}''.", host, port));
     144                Logging.warn(tr("The proxy will not be used."));
    144145            }
    145146        }
     
    153154    public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {
    154155        // Just log something. The network stack will also throw an exception which will be caught somewhere else
    155         Main.error(tr("Connection to proxy ''{0}'' for URI ''{1}'' failed. Exception was: {2}", sa.toString(), uri.toString(), ioe.toString()));
     156        Logging.error(tr("Connection to proxy ''{0}'' for URI ''{1}'' failed. Exception was: {2}",
     157                sa.toString(), uri.toString(), ioe.toString()));
    156158        // Remember errors to give a friendly user message asking to review proxy configuration
    157159        errorResources.add(uri.toString());
     
    203205        case USE_SYSTEM_SETTINGS:
    204206            if (!jvmWillUseSystemProxies) {
    205                 Main.warn(tr("The JVM is not configured to lookup proxies from the system settings. "+
     207                Logging.warn(tr("The JVM is not configured to lookup proxies from the system settings. "+
    206208                        "The property ''java.net.useSystemProxies'' was missing at startup time.  Will not use a proxy."));
    207209                return NO_PROXY_LIST;
Note: See TracChangeset for help on using the changeset viewer.