protected Log newInstance()

in src/main/java/org/apache/commons/logging/impl/LogFactoryImpl.java [551:587]


    protected Log newInstance(final String name) throws LogConfigurationException {
        Log instance;
        try {
            if (logConstructor == null) {
                instance = discoverLogImplementation(name);
            }
            else {
                final Object params[] = { name };
                instance = (Log) logConstructor.newInstance(params);
            }

            if (logMethod != null) {
                final Object params[] = { this };
                logMethod.invoke(instance, params);
            }

            return instance;

        } catch (final LogConfigurationException lce) {

            // this type of exception means there was a problem in discovery
            // and we've already output diagnostics about the issue, etc.;
            // just pass it on
            throw lce;

        } catch (final InvocationTargetException e) {
            // A problem occurred invoking the Constructor or Method
            // previously discovered
            final Throwable c = e.getTargetException();
            throw new LogConfigurationException(c == null ? e : c);
        } catch (final Throwable t) {
            handleThrowable(t); // may re-throw t
            // A problem occurred invoking the Constructor or Method
            // previously discovered
            throw new LogConfigurationException(t);
        }
    }