Fix padding of dates and times in log format
This commit is contained in:
parent
ef692a31d5
commit
e76b0e72ff
2 changed files with 8 additions and 10 deletions
|
@ -115,13 +115,11 @@ class Processor private constructor() {
|
|||
if (
|
||||
(channelconf.sanitizeMessage ?: ChannelSettings.global.sanitizeMessage) != false
|
||||
&& (channelconf.permitFormatting ?: ChannelSettings.global.permitFormatting) != false
|
||||
)
|
||||
message = message.replace("<", "\\<")
|
||||
) message = message.replace("<", "\\<")
|
||||
if (
|
||||
((channelconf.permitFormatting ?: ChannelSettings.global.permitFormatting) != false)
|
||||
&& LoggerConfiguration.features.contains(Feature.FORMATTING)
|
||||
)
|
||||
format.addFeature(Feature.FORMATTING)
|
||||
) format.addFeature(Feature.FORMATTING)
|
||||
|
||||
// Set message
|
||||
format.message = message
|
||||
|
|
|
@ -91,20 +91,20 @@ class SOSLSv2FormatBuilder(call: Call) : FormatBuilder(call) {
|
|||
format.append("[")
|
||||
if (enabledFeatures.contains(Feature.DATE))
|
||||
format
|
||||
.append(datetime.dayOfMonth)
|
||||
.append("%02d".format(datetime.dayOfMonth.toString()))
|
||||
.append(".")
|
||||
.append(datetime.monthNumber)
|
||||
.append("%02d".format(datetime.monthNumber))
|
||||
.append(".")
|
||||
.append(datetime.year)
|
||||
.append("%04d".format(datetime.year))
|
||||
if (enabledFeatures.contains(Feature.DATE) && enabledFeatures.contains(Feature.TIME))
|
||||
format.append(" ")
|
||||
if (enabledFeatures.contains(Feature.TIME))
|
||||
format
|
||||
.append(datetime.hour)
|
||||
.append("%02d".format(datetime.hour))
|
||||
.append(":")
|
||||
.append(datetime.minute)
|
||||
.append("%02d".format(datetime.minute))
|
||||
.append(":")
|
||||
.append(datetime.second)
|
||||
.append("%02d".format(datetime.second))
|
||||
if (enabledFeatures.contains(Feature.DATE) || enabledFeatures.contains(Feature.TIME))
|
||||
format.append("] ")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue