Project

General

Profile

« Previous | Next » 

Revision 3078

Added by Matt Jones over 17 years ago

Eliminated the MetacatUtil.printMessage() method in favor of using the Log4J debugging methods.

View differences:

MetaCatUtil.java
114 114
            options = edu.ucsb.nceas.utilities.Options.getInstance();
115 115
        }
116 116
        if (options == null) {
117
        	MetaCatUtil.printMessage("options is null");
117
            Logger logMetacat = Logger.getLogger(MetaCatUtil.class);
118
        	logMetacat.info("options is null");
118 119
        }
119 120
        String value = options.getOption(optionName);
120 121
        return value;
......
224 225
        }
225 226
        return parameters;
226 227
    }
227

  
228
    /**
229
     * Utility method to print debugging messages. User can set debug level for
230
     * this message. The number is fewer, the message is more important
231
     *
232
     * @param msg, the content of the message
233
     * @param debugLevel, an integer indicating the message debug leve
234
     */
235
    /** 
236
     * Commenting out the function for now...
237
     * public static void debugMessage(String msg, int debugLevel)
238
     * {
239
     *   if (debug) {
240
     *       int limit = 1;
241
     *       try {
242
     *           limit = Integer.parseInt(getOption("debuglevel"));
243
     *
244
     *       } catch (Exception e) {
245
     *           System.out.println(e.getMessage());
246
     *       }
247
     *       //don't allow the user set debugLevel less than or equals 0
248
     *       if (debugLevel <= 0) {
249
     *           debugLevel = 1;
250
     *       }
251
     *
252
     *       if (debugLevel < limit) {
253
     *           System.err.println("@debugprefix@ " + msg);
254
     *       }
255
     *   }
256
     *}
257
     */
258

  
259

  
260
    /**
261
     * Utility method to print debugging messages. User can set debug level for
262
     * this message. The number is fewer, the message is more important
263
     *
264
     * @param msg, the content of the message
265
     * @param debugLevel, an integer indicating the message debug leve
266
     */
267
    public static void printMessage(String msg)
268
    {
269
    	System.err.println("@debugprefix@ " + msg);
270
    }
271
    
272 228
  
273 229
    public static Vector getOptionList(String optiontext)
274 230
    {

Also available in: Unified diff