File tree 1 file changed +7
-3
lines changed
slf4j-api/src/main/java/org/slf4j
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ public final class LoggerFactory {
81
81
static final String UNSUCCESSFUL_INIT_URL = CODES_PREFIX + "#unsuccessfulInit" ;
82
82
static final String UNSUCCESSFUL_INIT_MSG = "org.slf4j.LoggerFactory in failed state. Original exception was thrown EARLIER. See also "
83
83
+ UNSUCCESSFUL_INIT_URL ;
84
+ static final String UNSUCCESSFUL_INIT_MSG_SUPPRESSION_SYSTEM_PROPERTY = "slf4j.suppressInitError" ;
84
85
85
86
static final int UNINITIALIZED = 0 ;
86
87
static final int ONGOING_INITIALIZATION = 1 ;
@@ -159,9 +160,12 @@ private final static void bind() {
159
160
SUBST_PROVIDER .getSubstituteLoggerFactory ().clear ();
160
161
} else {
161
162
INITIALIZATION_STATE = NOP_FALLBACK_INITIALIZATION ;
162
- Util .report ("No SLF4J providers were found." );
163
- Util .report ("Defaulting to no-operation (NOP) logger implementation" );
164
- Util .report ("See " + NO_PROVIDERS_URL + " for further details." );
163
+ boolean suppressError = Util .safeGetBooleanSystemProperty (UNSUCCESSFUL_INIT_MSG_SUPPRESSION_SYSTEM_PROPERTY );
164
+ if (!suppressError ) {
165
+ Util .report ("No SLF4J providers were found." );
166
+ Util .report ("Defaulting to no-operation (NOP) logger implementation" );
167
+ Util .report ("See " + NO_PROVIDERS_URL + " for further details." );
168
+ }
165
169
166
170
Set <URL > staticLoggerBinderPathSet = findPossibleStaticLoggerBinderPathSet ();
167
171
reportIgnoredStaticLoggerBinders (staticLoggerBinderPathSet );
You can’t perform that action at this time.
0 commit comments