From 0decdb3e0eb85d9abca8f19c0d8acc00d6ecbd12 Mon Sep 17 00:00:00 2001 From: sfc-gh-astachowski Date: Tue, 19 Nov 2024 13:37:33 +0100 Subject: [PATCH] Added restoration of original logging level --- .../client/log/JDK14LoggerWithClientLatestIT.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/test/java/net/snowflake/client/log/JDK14LoggerWithClientLatestIT.java b/src/test/java/net/snowflake/client/log/JDK14LoggerWithClientLatestIT.java index 731e630ce..f7302a9ad 100644 --- a/src/test/java/net/snowflake/client/log/JDK14LoggerWithClientLatestIT.java +++ b/src/test/java/net/snowflake/client/log/JDK14LoggerWithClientLatestIT.java @@ -23,6 +23,8 @@ import net.snowflake.client.jdbc.SnowflakeSQLException; import net.snowflake.client.jdbc.SnowflakeSQLLoggedException; import org.apache.commons.io.FileUtils; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; @@ -33,6 +35,19 @@ public class JDK14LoggerWithClientLatestIT extends AbstractDriverIT { @TempDir public File tmpFolder; String homePath = systemGetProperty("user.home"); + static private Level originalLevel; + + @BeforeAll + static void saveLevel(){ + originalLevel = JDK14Logger.getLevel(); + } + + @AfterAll + static void restoreLevel(){ + if (originalLevel != null) { + JDK14Logger.setLevel(originalLevel); + } + } @Test @Disabled