RFR: 8294402: Add diagnostic logging to VMProps.checkDockerSupport [v2]

David Holmes dholmes at openjdk.org
Tue Jan 31 00:19:28 UTC 2023


On Tue, 31 Jan 2023 00:14:45 GMT, Mikhailo Seledtsov <mseledtsov at openjdk.org> wrote:

>> Add log() and logToFile() methods to VMProps for diagnostic purposes.
>
> Mikhailo Seledtsov has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Comment about logging to stdout
>  - Conditionally enable VMProps logging

test/jtreg-ext/requires/VMProps.java line 531:

> 529:         log("checkDockerSupport(): entering");
> 530:         ProcessBuilder pb = new ProcessBuilder(Container.ENGINE_COMMAND, "ps");
> 531:         redirectOutputToLogFile("checkDockerSupport(): <container> ps", pb, "container-ps");

I was thinking it would be better to see this output in the main log, rather than have to go and find the file later. Where would the file even be found?

test/jtreg-ext/requires/VMProps.java line 659:

> 657:     protected static void log(String msg) {
> 658:         // By jtreg design stderr produced here will be visible
> 659:         // in the output of a parent process.

Suggest extending the comment:

// in the output of a parent process. stdout should not be used for logging as jtreg parses that output directly
// and only echoes it in the event of a failure.

-------------

PR: https://git.openjdk.org/jdk/pull/12239


More information about the hotspot-dev mailing list