Skip to content

Commit

Permalink
8332113: Update nsk.share.Log to be always verbose
Browse files Browse the repository at this point in the history
Reviewed-by: sspitsyn, cjplummer
  • Loading branch information
lmesnik committed Jun 14, 2024
1 parent 548e95a commit 8464ce6
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions test/hotspot/jtreg/vmTestbase/nsk/share/Log.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ public class Log {

/**
* Is log-mode verbose?
* Default value is <code>false</code>.
* Always enabled.
*/
private boolean verbose = false;
private final boolean verbose = true;

/**
* Should log messages prefixed with timestamps?
* Default value is <code>false</code>.
* Always enabled.
*/
private boolean timestamp = false;
private final boolean timestamp = true;

/**
* Names for trace levels
Expand Down Expand Up @@ -193,7 +193,6 @@ public Log(PrintStream stream) {
*/
public Log(PrintStream stream, boolean verbose) {
this(stream);
this.verbose = verbose;
}

/**
Expand All @@ -204,7 +203,6 @@ public Log(PrintStream stream, boolean verbose) {
public Log(PrintStream stream, ArgumentParser argsParser) {
this(stream, argsParser.verbose());
traceLevel = argsParser.getTraceLevel();
timestamp = argsParser.isTimestamp();
}

/////////////////////////////////////////////////////////////////
Expand All @@ -220,10 +218,9 @@ public boolean verbose() {
* Enable or disable verbose mode for printing messages.
*/
public void enableVerbose(boolean enable) {
if (!verbose) {
flushLogBuffer();
if (!enable) {
throw new RuntimeException("The non-verbose logging is not supported.");
}
verbose = enable;
}

public int getTraceLevel() {
Expand Down Expand Up @@ -422,7 +419,6 @@ protected synchronized void logTo(PrintStream stream) {
out.flush();
}
out = stream;
verbose = true;
}

/////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 8464ce6

Please sign in to comment.