Make native loading logging less confusing (#10944)
Motivation: We produced a lot of noise during loading native libraries as we always included the stacktrace if we could not load by one mechanism. We should better just not include the stacktrace in the debugging logging if one mechanism fails. We will log all the stacks anyway when all of the mechanisms fail. Modifications: Make logging less aggressive Result: Less confusing behaviour for the end-user
This commit is contained in:
parent
94646ac546
commit
4d43f16bb9
@ -97,9 +97,9 @@ public final class NativeLibraryLoader {
|
|||||||
return;
|
return;
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
suppressed.add(t);
|
suppressed.add(t);
|
||||||
logger.debug("Unable to load the library '{}', trying next name...", name, t);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IllegalArgumentException iae =
|
IllegalArgumentException iae =
|
||||||
new IllegalArgumentException("Failed to load any of the given libraries: " + Arrays.toString(names));
|
new IllegalArgumentException("Failed to load any of the given libraries: " + Arrays.toString(names));
|
||||||
ThrowableUtil.addSuppressedAndClear(iae, suppressed);
|
ThrowableUtil.addSuppressedAndClear(iae, suppressed);
|
||||||
@ -137,11 +137,6 @@ public final class NativeLibraryLoader {
|
|||||||
return;
|
return;
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
suppressed.add(ex);
|
suppressed.add(ex);
|
||||||
if (logger.isDebugEnabled()) {
|
|
||||||
logger.debug(
|
|
||||||
"{} cannot be loaded from java.library.path, "
|
|
||||||
+ "now trying export to -Dio.netty.native.workdir: {}", name, WORKDIR, ex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String libname = System.mapLibraryName(name);
|
String libname = System.mapLibraryName(name);
|
||||||
@ -343,10 +338,8 @@ public final class NativeLibraryLoader {
|
|||||||
return;
|
return;
|
||||||
} catch (UnsatisfiedLinkError e) { // Should by pass the UnsatisfiedLinkError here!
|
} catch (UnsatisfiedLinkError e) { // Should by pass the UnsatisfiedLinkError here!
|
||||||
suppressed = e;
|
suppressed = e;
|
||||||
logger.debug("Unable to load the library '{}', trying other loading mechanism.", name, e);
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
suppressed = e;
|
suppressed = e;
|
||||||
logger.debug("Unable to load the library '{}', trying other loading mechanism.", name, e);
|
|
||||||
}
|
}
|
||||||
NativeLibraryUtil.loadLibrary(name, absolute); // Fallback to local helper class.
|
NativeLibraryUtil.loadLibrary(name, absolute); // Fallback to local helper class.
|
||||||
logger.debug("Successfully loaded the library {}", name);
|
logger.debug("Successfully loaded the library {}", name);
|
||||||
|
Loading…
Reference in New Issue
Block a user