RFR: 8332113: Update nsk.share.Log to be always verbose
Chris Plummer
cjplummer at openjdk.org
Thu Jun 13 23:44:16 UTC 2024
On Sat, 8 Jun 2024 18:05:36 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:
> The nsk.share.Log has 3 parameters that might be configured by tests or using command-line:
> - verbose, traceLevel and timestamp
>
> The main purpose of these modes was to minimize output and use command-line arguments to enable them during bug reproducing/debugging for vmTestbase when it was compiled separately.
>
> However, such an approach has several disadvantages:
> -- For intermittent issues, there is no all data in the logs
> -- The enabling log might affect test behavior
> -- No easy way to set these command-line options for jtreg tests
> -- When verbose mode is disabled the messages are saved in some buffer and printed only test complains. The mode causes issues if the test fails without complaining (exception, crash, etc). The messages are just never printed.
> -- the solution is over-complicated.
>
> The fix enabled verbose mode and printing time stamps always, setting the debugging log level.
>
> The plan is to remove all these options and simplify logging as much as possible in the future.
test/hotspot/jtreg/vmTestbase/nsk/share/Log.java line 130:
> 128: * Default value is <code>0</code> a.k.a. <code>TraceLevel.INFO</code>;
> 129: */
> 130: private final int traceLevel = TraceLevel.TRACE_DEBUG + 1;
Can you explain this change?
test/hotspot/jtreg/vmTestbase/nsk/share/Log.java line 226:
> 224: flushLogBuffer();
> 225: }
> 226: verbose = enable;
I assume this API should never be called with "false" as an argument. Maybe we should throw an exception if it is.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19613#discussion_r1639050229
PR Review Comment: https://git.openjdk.org/jdk/pull/19613#discussion_r1639050565
More information about the hotspot-runtime-dev
mailing list