Adding more meta information about the user to the GATK logging output, per Tim F's request.

This commit is contained in:
Eric Banks 2014-01-13 14:36:02 -05:00
parent c86e36c909
commit 851ec67bdc
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.