Skip to content

Commit 0338d60

Browse files
committed
Add seconds to log timestamps to avoid log name clashes.
1 parent 02e3883 commit 0338d60

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

compiler/test/dotty/tools/dotc/reporting/TestReporter.scala

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,13 @@ object TestReporter {
8484
private[this] var logWriter: PrintWriter = _
8585

8686
private[this] def initLog() = if (logWriter eq null) {
87-
val df = new SimpleDateFormat("yyyy-MM-dd-HH:mm")
88-
val timestamp = df.format(new Date)
89-
new JFile("../testlogs").mkdirs()
90-
outFile = new JFile(s"../testlogs/tests-$timestamp.log")
87+
val df0 = new SimpleDateFormat("yyyy-MM-dd")
88+
val df1 = new SimpleDateFormat("yyyy-MM-dd-HH:mm:ss")
89+
val timestamp0 = df0.format(new Date)
90+
val timestamp = df1.format(new Date)
91+
val folder = s"../testlogs/tests-$timestamp0"
92+
new JFile(folder).mkdirs()
93+
outFile = new JFile(s"$folder/tests-$timestamp.log")
9194
logWriter = new PrintWriter(new FileOutputStream(outFile, true))
9295
}
9396

0 commit comments

Comments
 (0)