Skip to content

Instantly share code, notes, and snippets.

@whalemare
Created October 17, 2019 08:16
Show Gist options
  • Save whalemare/a1dbf2afde6c3ebef183f739d7669b78 to your computer and use it in GitHub Desktop.
Save whalemare/a1dbf2afde6c3ebef183f739d7669b78 to your computer and use it in GitHub Desktop.
Logger
/**
* @since 2019
* @author Anton Vlasov - whalemare
*/
class Main {
fun main(args: Array<String>) {
logger("hello")
}
}
inline fun <reified T: Any> T.logger(message: String) {
createLogger(T::class)(message)
}
fun <T> createLogger(clazz: T): (message: String) -> Unit {
// do something and return logger
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment