diff --git a/src/main/java/software/amazon/awssdk/crt/CrtResource.java b/src/main/java/software/amazon/awssdk/crt/CrtResource.java index ea3eb5ba6..8f4aa5b40 100644 --- a/src/main/java/software/amazon/awssdk/crt/CrtResource.java +++ b/src/main/java/software/amazon/awssdk/crt/CrtResource.java @@ -373,9 +373,13 @@ public static void collectNativeResource(Consumer fn) { * Debug method to log all of the currently un-closed CRTResource objects. */ public static void logNativeResources() { - Log.log(ResourceLogLevel, Log.LogSubject.JavaCrtResource, "Dumping native object set:"); + logNativeResources(ResourceLogLevel); + } + + public static void logNativeResources(Log.LogLevel logLevel) { + Log.log(logLevel, Log.LogSubject.JavaCrtResource, "Dumping native object set:"); collectNativeResource((resource) -> { - Log.log(ResourceLogLevel, Log.LogSubject.JavaCrtResource, resource.getWrapper().getResourceLogDescription()); + Log.log(logLevel, Log.LogSubject.JavaCrtResource, resource.getWrapper().getResourceLogDescription()); }); } @@ -436,7 +440,7 @@ public static void waitForNoResources() { if (resourceCount != 0) { Log.log(Log.LogLevel.Error, Log.LogSubject.JavaCrtResource, "waitForNoResources - timeOut"); - logNativeResources(); + logNativeResources(Log.LogLevel.Error); throw new InterruptedException(); } } catch (InterruptedException e) {