comparison src/share/vm/logging/logConfiguration.cpp @ 10939:8005261869c9

8151526: Print -Xlog configuration in the hs_err_pid file Summary: logging configuration is now printed in hs_err and in vm info. Reviewed-by: coleenp, mlarsson, dholmes
author mockner
date Tue, 19 Apr 2016 11:03:37 -0400
parents 5bc83f454d50
children d525d1232cdc
comparison
equal deleted inserted replaced
11:c82475eba5f9 12:d09ab8b6e66f
380 configure_output(idx, expr, decorators); 380 configure_output(idx, expr, decorators);
381 notify_update_listeners(); 381 notify_update_listeners();
382 return true; 382 return true;
383 } 383 }
384 384
385 void LogConfiguration::describe(outputStream* out) { 385 void LogConfiguration::describe_available(outputStream* out){
386 out->print("Available log levels:"); 386 out->print("Available log levels:");
387 for (size_t i = 0; i < LogLevel::Count; i++) { 387 for (size_t i = 0; i < LogLevel::Count; i++) {
388 out->print("%s %s", (i == 0 ? "" : ","), LogLevel::name(static_cast<LogLevelType>(i))); 388 out->print("%s %s", (i == 0 ? "" : ","), LogLevel::name(static_cast<LogLevelType>(i)));
389 } 389 }
390 out->cr(); 390 out->cr();
400 for (size_t i = 1; i < LogTag::Count; i++) { 400 for (size_t i = 1; i < LogTag::Count; i++) {
401 out->print("%s %s", (i == 1 ? "" : ","), LogTag::name(static_cast<LogTagType>(i))); 401 out->print("%s %s", (i == 1 ? "" : ","), LogTag::name(static_cast<LogTagType>(i)));
402 } 402 }
403 out->cr(); 403 out->cr();
404 404
405 ConfigurationLock cl; 405 }
406
407 void LogConfiguration::describe_current_configuration(outputStream* out){
406 out->print_cr("Log output configuration:"); 408 out->print_cr("Log output configuration:");
407 for (size_t i = 0; i < _n_outputs; i++) { 409 for (size_t i = 0; i < _n_outputs; i++) {
408 out->print("#" SIZE_FORMAT ": %s %s ", i, _outputs[i]->name(), _outputs[i]->config_string()); 410 out->print("#" SIZE_FORMAT ": %s %s ", i, _outputs[i]->name(), _outputs[i]->config_string());
409 for (size_t d = 0; d < LogDecorators::Count; d++) { 411 for (size_t d = 0; d < LogDecorators::Count; d++) {
410 LogDecorators::Decorator decorator = static_cast<LogDecorators::Decorator>(d); 412 LogDecorators::Decorator decorator = static_cast<LogDecorators::Decorator>(d);
412 out->print("%s,", LogDecorators::name(decorator)); 414 out->print("%s,", LogDecorators::name(decorator));
413 } 415 }
414 } 416 }
415 out->cr(); 417 out->cr();
416 } 418 }
419 }
420
421 void LogConfiguration::describe(outputStream* out) {
422 describe_available(out);
423 ConfigurationLock cl;
424 describe_current_configuration(out);
417 } 425 }
418 426
419 void LogConfiguration::print_command_line_help(FILE* out) { 427 void LogConfiguration::print_command_line_help(FILE* out) {
420 jio_fprintf(out, "-Xlog Usage: -Xlog[:[what][:[output][:[decorators][:output-options]]]]\n" 428 jio_fprintf(out, "-Xlog Usage: -Xlog[:[what][:[output][:[decorators][:output-options]]]]\n"
421 "\t where 'what' is a combination of tags and levels on the form tag1[+tag2...][*][=level][,...]\n" 429 "\t where 'what' is a combination of tags and levels on the form tag1[+tag2...][*][=level][,...]\n"