ehsansouri23 / Logger

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logger library

Usage

 counterLog {
    log withName "request_count" withValue 2.0 withTag {
        "is_api" to "true"
    } withTag {
        "has_user" to "false"
    }
}

// time logging
timerLog {
    log withName "function_call" withTag {
        "is_api" to "true"
    } withTag {
        "has_user" to "false"
    } withBlock {
        myFunctionToMeasureItsTime()
    }
}

// time logging with return value
val value = LoggerService.withTimeLogging(
    "function_call",
    mapOf("is_api" to "true", "has_user" to "false")
) {
    myFunctionToMeasureItsTimeWithReturnvalue()
}

About


Languages

Language:Kotlin 100.0%