This repository was archived by the owner on Aug 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +20
-8
lines changed
src/test/java/com/trivadis/plsql/formatter Expand file tree Collapse file tree 3 files changed +20
-8
lines changed Original file line number Diff line number Diff line change 1919 <skip .native>true</skip .native>
2020 <!-- relevant when skip.native is false, valid: "no", "force" -->
2121 <native .image.fallback>force</native .image.fallback>
22+ <disable .logging>true</disable .logging>
2223 </properties >
2324 <dependencies >
2425 <!-- GraalVM JavaScript engine used for testing format.js as if executed via SQLcl -->
267268 <includes >
268269 <include >**/*.java</include >
269270 </includes >
271+ <systemPropertyVariables >
272+ <disable .logging>${disable.logging} </disable .logging>
273+ </systemPropertyVariables >
270274 </configuration >
271275 </plugin >
272276 </plugins >
Original file line number Diff line number Diff line change @@ -28,11 +28,15 @@ private void setArboriHome() {
2828 }
2929
3030 private void loadLoggingConf () {
31+ var disableLogging = System .getProperty ("disable.logging" );
3132 var manager = LogManager .getLogManager ();
32- try {
33- manager .readConfiguration (Thread .currentThread ().getContextClassLoader ().getResourceAsStream ("logging.conf" ));
34- } catch (SecurityException | IOException e ) {
35- e .printStackTrace ();
33+ manager .reset ();
34+ if (disableLogging != null && !disableLogging .trim ().equalsIgnoreCase ("true" )) {
35+ try {
36+ manager .readConfiguration (Thread .currentThread ().getContextClassLoader ().getResourceAsStream ("logging.conf" ));
37+ } catch (SecurityException | IOException e ) {
38+ e .printStackTrace ();
39+ }
3640 }
3741 }
3842
Original file line number Diff line number Diff line change @@ -31,11 +31,15 @@ public abstract class AbstractSqlclTest {
3131 }
3232
3333 private void loadLoggingConf () {
34+ var disableLogging = System .getProperty ("disable.logging" );
3435 var manager = LogManager .getLogManager ();
35- try {
36- manager .readConfiguration (Thread .currentThread ().getContextClassLoader ().getResourceAsStream ("logging.conf" ));
37- } catch (SecurityException | IOException e ) {
38- e .printStackTrace ();
36+ manager .reset ();
37+ if (disableLogging != null && !disableLogging .trim ().equalsIgnoreCase ("true" )) {
38+ try {
39+ manager .readConfiguration (Thread .currentThread ().getContextClassLoader ().getResourceAsStream ("logging.conf" ));
40+ } catch (SecurityException | IOException e ) {
41+ e .printStackTrace ();
42+ }
3943 }
4044 }
4145
You can’t perform that action at this time.
0 commit comments