Created
December 5, 2017 20:50
-
-
Save oshai/d5ebd1f38de8198c6f11c3a232be2782 to your computer and use it in GitHub Desktop.
exposed logging
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage | |
transaction { | |
logger.addLogger(KotlinLoggingSqlLogger) | |
... | |
} | |
// Declaration | |
object KotlinLoggingSqlLogger : SqlLogger { | |
private val logger = KotlinLogging.logger { } | |
override | |
fun log(context: StatementContext, transaction: Transaction) { | |
logger.info { "SQL: ${context.expandArgs(transaction)}" } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment