aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Stucki <nicolas.stucki@gmail.com>2017-04-20 11:13:48 +0200
committerNicolas Stucki <nicolas.stucki@gmail.com>2017-04-20 11:22:54 +0200
commit5d8a57b0fec1b1ab53361d36beb3be01b78b1d08 (patch)
tree1a67d797550d0b9c5afb110b36f22aaa6edd45ee
parent02e38832668ed2a0504a77dd4f86270fa1a1d4bf (diff)
downloaddotty-5d8a57b0fec1b1ab53361d36beb3be01b78b1d08.zip
dotty-5d8a57b0fec1b1ab53361d36beb3be01b78b1d08.tar.gz
dotty-5d8a57b0fec1b1ab53361d36beb3be01b78b1d08.tar.bz2
Add seconds to log timestamps to avoid log name clashes.
-rw-r--r--compiler/test/dotty/tools/dotc/reporting/TestReporter.scala10
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala b/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala
index d07d31c..664526c 100644
--- a/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala
+++ b/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala
@@ -84,10 +84,12 @@ object TestReporter {
private[this] var logWriter: PrintWriter = _
private[this] def initLog() = if (logWriter eq null) {
- val df = new SimpleDateFormat("yyyy-MM-dd-HH:mm")
- val timestamp = df.format(new Date)
- new JFile("../testlogs").mkdirs()
- outFile = new JFile(s"../testlogs/tests-$timestamp.log")
+ val date = new Date
+ val df0 = new SimpleDateFormat("yyyy-MM-dd")
+ val df1 = new SimpleDateFormat("yyyy-MM-dd-HH:mm:ss")
+ val folder = s"../testlogs/tests-${df0.format(date)}"
+ new JFile(folder).mkdirs()
+ outFile = new JFile(s"$folder/tests-${df1.format(date)}.log")
logWriter = new PrintWriter(new FileOutputStream(outFile, true))
}