@Test public void getLogger() { Assert.assertNotNull(LoggerFactory.getLogger(LoggerFactoryTest.class)); }
public static Logger getLogger(String name) { try { Object logInstance = ClassUtils.forName(implClass, Logger.class.getClassLoader()) .getConstructor(String.class) .newInstance(name); if (logInstance instanceof Logger) { return (Logger) logInstance; } else { throw new SofaRpcRuntimeException(implClass + " is not type of " + Logger.class); } } catch (SofaRpcRuntimeException ex) { throw ex; } catch (Exception e) { throw new SofaRpcRuntimeException("Error when getLogger of " + name + ", implement is " + implClass + "", e); } }
LoggerFactory { public static Logger getLogger(String name) { try { Object logInstance = ClassUtils.forName(implClass, Logger.class.getClassLoader()) .getConstructor(String.class) .newInstance(name); if (logInstance instanceof Logger) { return (Logger) logInstance; } else { throw new SofaRpcRuntimeException(implClass + " is not type of " + Logger.class); } } catch (SofaRpcRuntimeException ex) { throw ex; } catch (Exception e) { throw new SofaRpcRuntimeException("Error when getLogger of " + name + ", implement is " + implClass + "", e); } } }
LoggerFactory { public static Logger getLogger(String name) { try { Object logInstance = ClassUtils.forName(implClass, Logger.class.getClassLoader()) .getConstructor(String.class) .newInstance(name); if (logInstance instanceof Logger) { return (Logger) logInstance; } else { throw new SofaRpcRuntimeException(implClass + " is not type of " + Logger.class); } } catch (SofaRpcRuntimeException ex) { throw ex; } catch (Exception e) { throw new SofaRpcRuntimeException("Error when getLogger of " + name + ", implement is " + implClass + "", e); } }  }
LoggerFactory { public static Logger getLogger(String name) { try { Object logInstance = ClassUtils.forName(implClass, Logger.class.getClassLoader()) .getConstructor(String.class) .newInstance(name); if (logInstance instanceof Logger) { return (Logger) logInstance; } else { throw new SofaRpcRuntimeException(implClass + " is not type of " + Logger.class); } } catch (SofaRpcRuntimeException ex) { throw ex; } catch (Exception e) { throw new SofaRpcRuntimeException("Error when getLogger of " + name + ", implement is " + implClass + "", e); } }  static Logger getLogger(String name); static Logger getLogger(Class clazz); }
LoggerFactory { public static Logger getLogger(String name) { try { Object logInstance = ClassUtils.forName(implClass, Logger.class.getClassLoader()) .getConstructor(String.class) .newInstance(name); if (logInstance instanceof Logger) { return (Logger) logInstance; } else { throw new SofaRpcRuntimeException(implClass + " is not type of " + Logger.class); } } catch (SofaRpcRuntimeException ex) { throw ex; } catch (Exception e) { throw new SofaRpcRuntimeException("Error when getLogger of " + name + ", implement is " + implClass + "", e); } }  static Logger getLogger(String name); static Logger getLogger(Class clazz);  }