code: @SuppressWarnings("unchecked")
     private static LogAdapterFactory createAdapterFactory()
     {
        List<LogAdapterFactory> factories = Iterators.asList(ServiceLoader.load(LogAdapterFactory.class));
        if (factories.isEmpty())
        {
           /*
            * Always fall back to the JDK, even if our service loading mechanism is hosed for some reason.
            */
           factories = Arrays.asList((LogAdapterFactory) new JDKLogAdapterFactory());
        }
  
        /*
         * Sort factories by priority.
         */
        Collections.sort(factories, new WeightedComparator());
  
        /*
         * Use the factory with the highest priority.
         */
        return factories.get(0);
  
     }
docs: Called one by {@link #getAdapterFactory()} to obtain the {@link LogAdapterFactory} with the highest priority.