@@ -28,6 +28,8 @@ import com.twitter.scrooge.java_generator.ApacheJavaGenerator
28
28
29
29
import java .io .File
30
30
import java .io .FileWriter
31
+ import java .time .format .DateTimeFormatter
32
+ import java .time .LocalDateTime
31
33
import scala .collection .concurrent .TrieMap
32
34
33
35
object CompilerDefaults {
@@ -37,6 +39,8 @@ object CompilerDefaults {
37
39
38
40
class Compiler (val config : ScroogeConfig ) {
39
41
var fileMapWriter : scala.Option [FileWriter ] = None
42
+ // Optionally, format the timestamp if needed
43
+ val formatter : DateTimeFormatter = DateTimeFormatter .ofPattern(" yyyy-MM-dd HH:mm:ss" )
40
44
41
45
def run (): Unit = {
42
46
// if --gen-file-map is specified, prepare the map file.
@@ -74,7 +78,10 @@ class Compiler(val config: ScroogeConfig) {
74
78
)
75
79
val doc = parser.parseFile(inputFile).mapNamespaces(config.namespaceMappings)
76
80
77
- if (config.verbose) println(" + Compiling %s" .format(inputFile))
81
+ if (config.verbose) {
82
+ val currentDateTime : LocalDateTime = LocalDateTime .now()
83
+ println(" + %s Compiling %s" .format(currentDateTime.format(formatter), inputFile))
84
+ }
78
85
val resolvedDoc = TypeResolver ()(doc, Some (inputFile))
79
86
val generator =
80
87
GeneratorFactory (
@@ -98,7 +105,10 @@ class Compiler(val config: ScroogeConfig) {
98
105
_.getPath
99
106
}
100
107
if (config.verbose) {
101
- println(" + Generated %s" .format(generatedFiles.mkString(" , " )))
108
+ val currentDateTime : LocalDateTime = LocalDateTime .now()
109
+ println(
110
+ " + %s Generated %s"
111
+ .format(currentDateTime.format(formatter), generatedFiles.mkString(" , " )))
102
112
}
103
113
fileMapWriter.foreach { w =>
104
114
generatedFiles.foreach { path => w.write(inputFile + " -> " + path + " \n " ) }
0 commit comments