File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/main/kotlin/org/javacs/kt Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ object LogFormat: Formatter() {
22
22
}
23
23
24
24
private const val logTime = false
25
+ private const val logCaller = false
25
26
private var newline = System .lineSeparator()
26
27
private val date = Date ()
27
28
private var maxSource = 0
@@ -32,13 +33,16 @@ object LogFormat: Formatter() {
32
33
val time = if (logTime) " $date " else " "
33
34
34
35
var source: String
35
- if (record.sourceClassName != null ) {
36
+ val sourceWidth: Int
37
+ if (logCaller && record.sourceClassName != null ) {
36
38
source = record.sourceClassName.split(" ." ).last()
37
39
if (record.sourceMethodName != null ) {
38
40
source + = " ." + record.sourceMethodName
39
41
}
42
+ sourceWidth = 45
40
43
} else {
41
44
source = record.loggerName
45
+ sourceWidth = 6
42
46
}
43
47
44
48
val message = formatMessage(record)
@@ -59,7 +63,7 @@ object LogFormat: Formatter() {
59
63
2 , // padding between columns
60
64
FormatValue (prefix, 10 ),
61
65
FormatValue (shortenOrPad(thread, 10 )),
62
- FormatValue (source, 45 ),
66
+ FormatValue (source, sourceWidth ),
63
67
FormatValue (message)
64
68
) + throwable
65
69
}
You can’t perform that action at this time.
0 commit comments