MCPcopy
hub / github.com/qos-ch/slf4j / bind

Method bind

slf4j-api/src/main/java/org/slf4j/LoggerFactory.java:193–218  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

191 }
192
193 private final static void bind() {
194 try {
195 List<SLF4JServiceProvider> providersList = findServiceProviders();
196 reportMultipleBindingAmbiguity(providersList);
197 if (providersList != null && !providersList.isEmpty()) {
198 PROVIDER = providersList.get(0);
199 earlyBindMDCAdapter();
200 // SLF4JServiceProvider.initialize() is intended to be called here and nowhere else.
201 PROVIDER.initialize();
202 INITIALIZATION_STATE = SUCCESSFUL_INITIALIZATION;
203 reportActualBinding(providersList);
204 } else {
205 INITIALIZATION_STATE = NOP_FALLBACK_INITIALIZATION;
206 Reporter.warn("No SLF4J providers were found.");
207 Reporter.warn("Defaulting to no-operation (NOP) logger implementation");
208 Reporter.warn("See " + NO_PROVIDERS_URL + " for further details.");
209
210 Set<URL> staticLoggerBinderPathSet = findPossibleStaticLoggerBinderPathSet();
211 reportIgnoredStaticLoggerBinders(staticLoggerBinderPathSet);
212 }
213 postBindCleanUp();
214 } catch (Exception e) {
215 failedBinding(e);
216 throw new IllegalStateException("Unexpected initialization failure", e);
217 }
218 }
219
220 /**
221 * The value of PROVIDER.getMDCAdapter() can be null while PROVIDER has not yet initialized.

Callers 1

performInitializationMethod · 0.95

Calls 11

findServiceProvidersMethod · 0.95
earlyBindMDCAdapterMethod · 0.95
reportActualBindingMethod · 0.95
warnMethod · 0.95
postBindCleanUpMethod · 0.95
failedBindingMethod · 0.95
getMethod · 0.65
initializeMethod · 0.65

Tested by

no test coverage detected