Merge pull request #471 from broadinstitute/eb_output_log_info_for_tim

Adding more meta information about the user to the GATK logging output, per Tim F's request.
This commit is contained in:
droazen 2014-01-13 17:48:40 -08:00
commit 347fab4717
1 changed files with 19 additions and 0 deletions

View File

@ -30,6 +30,7 @@ import org.broadinstitute.sting.commandline.*;
import org.broadinstitute.sting.utils.Utils;
import org.broadinstitute.sting.utils.text.TextFormattingUtils;
import java.net.InetAddress;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
@ -295,6 +296,7 @@ public class HelpFormatter {
String output = sourceName + " Args: " + entry.getValue().getDescription();
logger.info(output);
}
logger.info(generateUserHelpData());
logger.info("Date/Time: " + dateFormat.format(date));
logger.info(barrier);
@ -303,6 +305,23 @@ public class HelpFormatter {
logger.info(barrier);
}
/**
* Create the user-related help information.
* @return a non-null, non-empty String with the relevant information.
*/
private static String generateUserHelpData() {
try {
return "Executing as " +
System.getProperty("user.name") + "@" + InetAddress.getLocalHost().getHostName() +
" on " + System.getProperty("os.name") + " " + System.getProperty("os.version") +
" " + System.getProperty("os.arch") + "; " + System.getProperty("java.vm.name") +
" " + System.getProperty("java.runtime.version") + ".";
} catch (Exception e) {
// don't fail
return "";
}
}
/**
* Create a barrier to use to distinguish the header from the rest of the output.
* @param text A collection of lines to output as part of a header.