Commit f79469b3 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

1 level nested output_dir now allowed for log file

parent aeb0739f
......@@ -64,13 +64,19 @@ trait PipelineCommand extends MainCommand with GatkLogging {
}
for (t <- 0 until argsSize) {
if (args(t) == "--outputDir" || args(t) == "-outDir") {
throw new IllegalArgumentException("Commandline argument is deprecated, should use config for this now")
throw new IllegalArgumentException("Commandline argument is deprecated, should use config for this now or use: -cv output_dir=<Path to output dir>")
}
}
val logDir: File = new File(Config.global.map.getOrElse("output_dir", "./").toString + File.separator + ".log")
val logFile = {
val pipelineName = this.getClass.getSimpleName.toLowerCase.split("""\$""").head
val pipelineConfig = Config.global.map.getOrElse(pipelineName, Map()).asInstanceOf[Map[String, Any]]
val pipelineOutputDir = new File(Config.global.map.getOrElse("output_dir", pipelineConfig.getOrElse("output_dir", "./")).toString)
val logDir: File = new File(pipelineOutputDir, ".log")
logDir.mkdirs()
val logFile = new File(logDir, "biopet." + BiopetQCommandLine.timestamp + ".log")
new File(logDir, "biopet." + BiopetQCommandLine.timestamp + ".log")
}
val a = new WriterAppender(new PatternLayout("%-5p [%d] [%C{1}] - %m%n"), new PrintWriter(logFile))
logger.addAppender(a)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment