Lumina Config
data class LuminaConfig(val name: String = "Lumina", val log: LuminaConfig.Log = Log(), val format: LuminaConfig.Format = Format(), val timeZone: TimeZone = TimeZone.UTC, val fileSystem: FileSystem = FileSystem.SYSTEM, val coroutineScope: CoroutineScope = CoroutineScope(SupervisorJob()), val fileMutex: Mutex = Mutex())(source)
Configuration container for Lumina.
Controls log directories, formatting, channels, rotation policies, and coroutine scope. Immutable once built; use LuminaDSL for easy construction.
Constructors
Link copied to clipboard
constructor(name: String = "Lumina", log: LuminaConfig.Log = Log(), format: LuminaConfig.Format = Format(), timeZone: TimeZone = TimeZone.UTC, fileSystem: FileSystem = FileSystem.SYSTEM, coroutineScope: CoroutineScope = CoroutineScope(SupervisorJob()), fileMutex: Mutex = Mutex())
Types
Link copied to clipboard
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)
})
Link copied to clipboard
data class Log(val directory: (currentDate: String) -> Path = { currentDate -> "./logs/$currentDate/".toPath() }, val rotation: LuminaConfig.Log.RotationConfig = RotationConfig(true, 30.days, 1.days), val channelSize: Int = Channel.UNLIMITED, val channel: Channel<Message> = Channel(channelSize))
Properties
Link copied to clipboard
Coroutine scope for log workers and rotation jobs.
Link copied to clipboard
Filesystem abstraction (defaults to okio.FileSystem.SYSTEM).
Link copied to clipboard
Formatting rules for messages, timestamps, and log file naming.
Link copied to clipboard
Logging behavior settings (directory layout, rotation, channel).