/** * Used for testing.. */ static Log getLog(final Class<?> clazz, LogSpi logImpl) { return new Log(clazz, logImpl); }
/** * Used for testing.. */ static Log getLog(final Class<?> clazz, final LogSpi logImpl) { return new Log(clazz, logImpl); }
/** * Used for testing.. */ static Log getLog(final Class<?> clazz, final LogSpi logImpl) { return new Log(clazz, logImpl); }
/** * Get the logger for the particular class. <code> * private static final Log LOG = Log.getLog(MyClass.class); * </code> * * @param clazz * class to log information about. * @return logger to use for logging. */ public static Log getLog(final Class<?> clazz) { try { // check that we're not logging ourselves if (LogSpi.class.isAssignableFrom(clazz)) { throw new IllegalArgumentException(); } // attempt to get an instance.. final LogSpi logImpl = (LogSpi) getSpiClass().newInstance(); return new Log(clazz, logImpl); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } }
/** * Get the logger for the particular class. <code> * private static final Log LOG = Log.getLog(MyClass.class); * </code> * * @param clazz * class to log information about. * @return logger to use for logging. */ public static Log getLog(final Class<?> clazz) { try { // check that we're not logging ourselves if (LogSpi.class.isAssignableFrom(clazz)) { throw new IllegalArgumentException(); } // attempt to get an instance.. LogSpi logImpl = (LogSpi) getSpiClass().newInstance(); return new Log(clazz, logImpl); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } }
/** * Get the logger for the particular class. <code> * private static final Log LOG = Log.getLog(MyClass.class); * </code> * * @param clazz * class to log information about. * @return logger to use for logging. */ public static Log getLog(final Class<?> clazz) { try { // check that we're not logging ourselves if (LogSpi.class.isAssignableFrom(clazz)) { throw new IllegalArgumentException(); } // attempt to get an instance.. final LogSpi logImpl = (LogSpi) getSpiClass().newInstance(); return new Log(clazz, logImpl); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } }