Ignore:
Timestamp:
2012-08-28T00:16:35+02:00 (12 years ago)
Author:
stoecker
Message:

some cleanup, mainly javadoc

File:
1 edited

Legend:

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

    r5460 r5481  
    1616import java.net.URI;
    1717import java.net.URISyntaxException;
     18import java.text.MessageFormat;
    1819import java.util.ArrayList;
    1920import java.util.Collection;
     
    151152    public MainMenu menu;
    152153
     154    /**
     155     * The data validation handler.
     156     */
    153157    public OsmValidator validator;
    154158    /**
     
    158162
    159163    /**
    160      * Print a message if logging is on.
     164     * Logging level (3 = debug, 2 = info, 1 = warn, 0 = none).
    161165     */
    162166    static public int log_level = 2;
     167    /**
     168     * Print a warning message if logging is on.
     169     * @param msg The message to print.
     170     */
    163171    static public void warn(String msg) {
    164172        if (log_level < 1)
     
    166174        System.out.println(msg);
    167175    }
     176    /**
     177     * Print an informational message if logging is on.
     178     * @param msg The message to print.
     179     */
    168180    static public void info(String msg) {
    169181        if (log_level < 2)
     
    171183        System.out.println(msg);
    172184    }
     185    /**
     186     * Print an debug message if logging is on.
     187     * @param msg The message to print.
     188     */
    173189    static public void debug(String msg) {
    174190        if (log_level < 3)
    175191            return;
    176192        System.out.println(msg);
     193    }
     194    /**
     195     * Print a formated warning message if logging is on. Calls {@link MessageFormat#format}
     196     * function to format text.
     197     * @param msg The formated message to print.
     198     * @param objects The objects to insert into format string.
     199     */
     200    static public void warn(String msg, Object... objects) {
     201        warn(MessageFormat.format(msg, objects));
     202    }
     203    /**
     204     * Print a formated informational message if logging is on. Calls {@link MessageFormat#format}
     205     * function to format text.
     206     * @param msg The formated message to print.
     207     * @param objects The objects to insert into format string.
     208     */
     209    static public void info(String msg, Object... objects) {
     210        info(MessageFormat.format(msg, objects));
     211    }
     212    /**
     213     * Print a formated debug message if logging is on. Calls {@link MessageFormat#format}
     214     * function to format text.
     215     * @param msg The formated message to print.
     216     * @param objects The objects to insert into format string.
     217     */
     218    static public void debug(String msg, Object... objects) {
     219        debug(MessageFormat.format(msg, objects));
    177220    }
    178221
Note: See TracChangeset for help on using the changeset viewer.