Skip to content

Latest commit

 

History

History
33 lines (28 loc) · 609 Bytes

README.md

File metadata and controls

33 lines (28 loc) · 609 Bytes

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()
}