1 21 22 27 28 package com.sun.activation.registries; 29 30 import java.io.*; 31 import java.util.logging.*; 32 33 36 public class LogSupport { 37 private static boolean debug = false; 38 private static Logger logger; 39 private static final Level level = Level.FINE; 40 41 static { 42 try { 43 debug = Boolean.getBoolean("javax.activation.debug"); 44 } catch (Throwable t) { 45 } 47 logger = Logger.getLogger("javax.activation"); 48 } 49 50 53 private LogSupport() { 54 } 56 57 public static void log(String msg) { 58 if (debug) 59 System.out.println(msg); 60 logger.log(level, msg); 61 } 62 63 public static void log(String msg, Throwable t) { 64 if (debug) 65 System.out.println(msg + "; Exception: " + t); 66 logger.log(level, msg, t); 67 } 68 69 public static boolean isLoggable() { 70 return debug || logger.isLoggable(level); 71 } 72 } 73 | Popular Tags |