All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.kr.jadekim.logger.pipeline.JLogPipe.kt Maven / Gradle / Ivy

There is a newer version: 2.0.10
Show newest version
package kr.jadekim.logger.pipeline

import kr.jadekim.logger.Log

interface JLogPipe {

    interface Key

    val key: Key

    fun install(pipeline: MutableList, index: Int) {
        pipeline.add(index, this)
    }

    fun handle(log: Log): Log?
}

fun List.handle(log: Log) {
    var temp: Log? = log

    for (each in this) {
        if (temp == null) {
            break
        }

        temp = each.handle(temp)
    }
}

fun List.contains(key: JLogPipe.Key): Boolean = find { it.key == key } != null




© 2015 - 2025 Weber Informatics LLC | Privacy Policy