Skip to content

Commit 51f5adf

Browse files
jyukutyotstuefe
authored andcommitted
8265047: Inconsistent warning message in jcmd VM.log
Reviewed-by: dholmes, stuefe, sspitsyn
1 parent ea30bd6 commit 51f5adf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/hotspot/share/logging/logConfiguration.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ bool LogConfiguration::parse_log_arguments(const char* outputstr,
427427

428428
ConfigurationLock cl;
429429
size_t idx;
430+
bool added = false;
430431
if (outputstr[0] == '#') { // Output specified using index
431432
int ret = sscanf(outputstr + 1, SIZE_FORMAT, &idx);
432433
if (ret != 1 || idx >= _n_outputs) {
@@ -447,16 +448,18 @@ bool LogConfiguration::parse_log_arguments(const char* outputstr,
447448
LogOutput* output = new_output(normalized, output_options, errstream);
448449
if (output != NULL) {
449450
idx = add_output(output);
451+
added = true;
450452
}
451-
} else if (output_options != NULL && strlen(output_options) > 0) {
452-
errstream->print_cr("Output options for existing outputs are ignored.");
453453
}
454454

455455
FREE_C_HEAP_ARRAY(char, normalized);
456456
if (idx == SIZE_MAX) {
457457
return false;
458458
}
459459
}
460+
if (!added && output_options != NULL && strlen(output_options) > 0) {
461+
errstream->print_cr("Output options for existing outputs are ignored.");
462+
}
460463
configure_output(idx, selections, decorators);
461464
notify_update_listeners();
462465
selections.verify_selections(errstream);

0 commit comments

Comments
 (0)