()
| 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. |
no test coverage detected