diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2017-04-20 14:03:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-20 14:03:56 +0200 |
commit | d5146387bfd7b3922983290a3c7d560c70045c06 (patch) | |
tree | d75219533920e9d830b2e333fcd159b394d71e2e /compiler/test | |
parent | 2ccd284da902cd49e013f5237a28c717e50d81e1 (diff) | |
parent | 5d8a57b0fec1b1ab53361d36beb3be01b78b1d08 (diff) | |
download | dotty-master.tar.gz dotty-master.tar.bz2 dotty-master.zip |
Add seconds to log timestamps to avoid log name clashes.
Diffstat (limited to 'compiler/test')
-rw-r--r-- | compiler/test/dotty/tools/dotc/reporting/TestReporter.scala | 10 |
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 d07d31c74..664526c98 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)) } |