private static LoggingProvider loadLoggingProvider ( ) { ServiceLoader < LoggingProvider > loader = new ServiceLoader < LoggingProvider > ( LoggingProvider . class ) ; String name = Configuration . get ( PROVIDER_PROPERTY ) ; if ( name == null ) { Collection < LoggingProvider > providers = loader . createAll ( ) ; switch ( providers . size ( ) ) { case 0 : InternalLogger . log ( Level . WARN , "No logging framework implementation found in classpath." + " Add tinylog-impl.jar for outputting log entries." ) ; return new NopLoggingProvider ( ) ; case 1 : return providers . iterator ( ) . next ( ) ; default : return new BundleLoggingProvider ( providers ) ; } } else if ( NOP_PROVIDER_NAME . equalsIgnoreCase ( name ) ) { return new NopLoggingProvider ( ) ; } else { LoggingProvider provider = loader . create ( name ) ; if ( provider == null ) { InternalLogger . log ( Level . ERROR , "Requested logging provider is not available. Logging will be disabled." ) ; return new NopLoggingProvider ( ) ; } else { return provider ; } } }
Loads the actual logging provider .