Removed -debug/--debug_mode.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5697 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
kshakir 2011-04-27 10:56:39 +00:00
parent ca817356b6
commit df35a143b2
3 changed files with 4 additions and 22 deletions

View File

@ -54,20 +54,12 @@ public abstract class CommandLineProgram {
required = false) required = false)
protected String toFile = null; protected String toFile = null;
/** do we want to generate debugging information with the logs */
@Argument(fullName = "debug_mode",
shortName = "debug",
doc = "Set the logging file string to include a lot of debugging information (SLOW!)",
required = false)
protected Boolean debugMode = false;
/** this is used to indicate if they've asked for help */ /** this is used to indicate if they've asked for help */
@Argument(fullName = "help", shortName = "h", doc = "Generate this help message", required = false) @Argument(fullName = "help", shortName = "h", doc = "Generate this help message", required = false)
public Boolean help = false; public Boolean help = false;
/** our logging output patterns */ /** our logging output patterns */
private static String patternString = "%-5p %d{HH:mm:ss,SSS} %C{1} - %m %n"; private static final String patternString = "%-5p %d{HH:mm:ss,SSS} %C{1} - %m %n";
private static String debugPatternString = "%n[level] %p%n[date]\t\t %d{dd MMM yyyy HH:mm:ss,SSS} %n[class]\t\t %C %n[location]\t %l %n[line number]\t %L %n[message]\t %m %n";
static { static {
/** /**
@ -250,14 +242,8 @@ public abstract class CommandLineProgram {
* level that was provided. * level that was provided.
* @param layout Pattern layout to format based on the logger level. * @param layout Pattern layout to format based on the logger level.
*/ */
@SuppressWarnings("unchecked")
private void setupLoggerLevel(PatternLayout layout) { private void setupLoggerLevel(PatternLayout layout) {
// if we're in debug mode, set the mode up layout.setConversionPattern(patternString);
if (debugMode) {
layout.setConversionPattern(debugPatternString);
} else {
layout.setConversionPattern(patternString);
}
// set the default logger level // set the default logger level
Level par; Level par;

View File

@ -47,7 +47,7 @@ object QCommandLine {
Runtime.getRuntime.addShutdownHook(new Thread { Runtime.getRuntime.addShutdownHook(new Thread {
/** Cleanup as the JVM shuts down. */ /** Cleanup as the JVM shuts down. */
override def run = { override def run() {
ProcessController.shutdown() ProcessController.shutdown()
qCommandLine.shutdown() qCommandLine.shutdown()
} }
@ -94,13 +94,12 @@ class QCommandLine extends CommandLineProgram with Logging {
*/ */
def execute = { def execute = {
qGraph.settings = settings qGraph.settings = settings
qGraph.debugMode = debugMode == true
for (script <- pluginManager.createAllTypes()) { for (script <- pluginManager.createAllTypes()) {
logger.info("Scripting " + pluginManager.getName(script.getClass.asSubclass(classOf[QScript]))) logger.info("Scripting " + pluginManager.getName(script.getClass.asSubclass(classOf[QScript])))
loadArgumentsIntoObject(script) loadArgumentsIntoObject(script)
try { try {
script.script script.script()
} catch { } catch {
case e: Exception => case e: Exception =>
throw new UserException.CannotExecuteQScript(script.getClass.getSimpleName + ".script() threw the following exception: " + e, e) throw new UserException.CannotExecuteQScript(script.getClass.getSimpleName + ".script() threw the following exception: " + e, e)

View File

@ -44,7 +44,6 @@ import org.broadinstitute.sting.queue.function.scattergather.{ScatterFunction, C
*/ */
class QGraph extends Logging { class QGraph extends Logging {
var settings: QGraphSettings = _ var settings: QGraphSettings = _
var debugMode = false
private def dryRun = !settings.run private def dryRun = !settings.run
private var numMissingValues = 0 private var numMissingValues = 0
@ -147,8 +146,6 @@ class QGraph extends Logging {
val functions = scatterGather.asInstanceOf[FunctionEdge] val functions = scatterGather.asInstanceOf[FunctionEdge]
.function.asInstanceOf[ScatterGatherableFunction] .function.asInstanceOf[ScatterGatherableFunction]
.generateFunctions() .generateFunctions()
if (this.debugMode)
logger.debug("Scattered into %d parts: %n%s".format(functions.size, functions.mkString(nl)))
addedFunctions ++= functions addedFunctions ++= functions
} }