Created
October 17, 2019 08:16
-
-
Save whalemare/a1dbf2afde6c3ebef183f739d7669b78 to your computer and use it in GitHub Desktop.
Logger
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
/** | |
* @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