From 851ec67bdc878c0f810cb2ca7cb4f227bf2e98a2 Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Mon, 13 Jan 2014 14:36:02 -0500 Subject: [PATCH] Adding more meta information about the user to the GATK logging output, per Tim F's request. --- .../sting/utils/help/HelpFormatter.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/public/java/src/org/broadinstitute/sting/utils/help/HelpFormatter.java b/public/java/src/org/broadinstitute/sting/utils/help/HelpFormatter.java index d700bff28..f2e3fad4b 100644 --- a/public/java/src/org/broadinstitute/sting/utils/help/HelpFormatter.java +++ b/public/java/src/org/broadinstitute/sting/utils/help/HelpFormatter.java @@ -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.