Format
data class Format(val message: (timestamp: String, coloredStrategyName: String, loggerName: String, content: Array<String>) -> String = { timestamp, coloredStrategyName, loggerName, content ->
val template = "[$timestamp] - $coloredStrategyName - $loggerName - "
content.joinToString("\n") { line -> "$template${line.replace("\n", "\n$template")}" }
}, val file: (directory: Path, strategyName: String) -> Path = { directory, strategyName ->
directory.resolve("$strategyName.log")
}, val time: DateTimeFormat<LocalDateTime> = LocalDateTime.Format {
hour(Padding.ZERO)
char(':')
minute(Padding.ZERO)
char(':')
second(Padding.ZERO)
char(':')
secondFraction(3)
}, val date: DateTimeFormat<LocalDateTime> = LocalDateTime.Format {
day(Padding.ZERO)
char('.')
monthNumber(Padding.ZERO)
char('.')
year(Padding.ZERO)
})(source)
Constructors
Link copied to clipboard
constructor(message: (timestamp: String, coloredStrategyName: String, loggerName: String, content: Array<String>) -> String = { timestamp, coloredStrategyName, loggerName, content ->
val template = "[$timestamp] - $coloredStrategyName - $loggerName - "
content.joinToString("\n") { line -> "$template${line.replace("\n", "\n$template")}" }
}, file: (directory: Path, strategyName: String) -> Path = { directory, strategyName ->
directory.resolve("$strategyName.log")
}, time: DateTimeFormat<LocalDateTime> = LocalDateTime.Format {
hour(Padding.ZERO)
char(':')
minute(Padding.ZERO)
char(':')
second(Padding.ZERO)
char(':')
secondFraction(3)
}, date: DateTimeFormat<LocalDateTime> = LocalDateTime.Format {
day(Padding.ZERO)
char('.')
monthNumber(Padding.ZERO)
char('.')
year(Padding.ZERO)
})
Functions
Link copied to clipboard
fun dateString(instant: Instant = Clock.System.now(), format: DateTimeFormat<LocalDateTime> = date): String
Link copied to clipboard
fun timeString(instant: Instant = Clock.System.now(), format: DateTimeFormat<LocalDateTime> = time): String