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

    r11535 r12620  
    5555import org.openstreetmap.josm.plugins.ReadLocalPluginInformationTask;
    5656import org.openstreetmap.josm.tools.LanguageInfo;
     57import org.openstreetmap.josm.tools.Logging;
    5758import org.openstreetmap.josm.tools.Utils;
    5859import org.w3c.dom.DOMException;
     
    100101     */
    101102    public static void log(Exception e, String s) {
    102         summary.append(s).append(' ').append(Main.getErrorMessage(e)).append('\n');
     103        summary.append(s).append(' ').append(Logging.getErrorMessage(e)).append('\n');
    103104    }
    104105
     
    206207            case 'q': JOptionPane.showMessageDialog(Main.parent, text, tr("Question"), JOptionPane.QUESTION_MESSAGE); break;
    207208            case 'p': JOptionPane.showMessageDialog(Main.parent, text, tr("Message"), JOptionPane.PLAIN_MESSAGE); break;
    208             default: Main.warn("Unsupported messageBox type: " + c);
     209            default: Logging.warn("Unsupported messageBox type: " + c);
    209210        }
    210211    }
     
    281282            root = document.getDocumentElement();
    282283        } catch (SAXException | IOException | ParserConfigurationException ex) {
    283             Main.warn(ex, "Error getting preferences to save:");
     284            Logging.log(Logging.LEVEL_WARN, "Error getting preferences to save:", ex);
    284285        }
    285286        if (root == null || exportDocument == null)
     
    310311            ts.transform(new DOMSource(exportDocument), new StreamResult(f.toURI().getPath()));
    311312        } catch (DOMException | TransformerFactoryConfigurationError | TransformerException ex) {
    312             Main.warn("Error saving preferences part:");
    313             Main.error(ex);
     313            Logging.warn("Error saving preferences part:");
     314            Logging.error(ex);
    314315        }
    315316    }
     
    375376                    while (busy) CustomConfigurator.class.wait();
    376377                } catch (InterruptedException ex) {
    377                     Main.warn(ex, "InterruptedException while reading local plugin information");
     378                    Logging.log(Logging.LEVEL_WARN, "InterruptedException while reading local plugin information", ex);
    378379                    Thread.currentThread().interrupt();
    379380                }
     
    495496            } catch (ScriptException ex) {
    496497                log("Error: initializing script engine: "+ex.getMessage());
    497                 Main.error(ex);
     498                Logging.error(ex);
    498499            }
    499500        }
     
    961962
    962963    private static void showPrefs(Preferences tmpPref) {
    963         Main.info("properties: " + tmpPref.settingsMap);
     964        Logging.info("properties: " + tmpPref.settingsMap);
    964965    }
    965966
Note: See TracChangeset for help on using the changeset viewer.