Last active
May 21, 2019 13:30
-
-
Save dtunctuncer/bdb5c45a5a871f8803171e235e4e92df to your computer and use it in GitHub Desktop.
//Logging methods and parameters with Timber via Live Template
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
//Logging methods and parameters with Timber via Live Template | |
Abbreviation: | |
timberm | |
Context: | |
Kotlin: statement | |
Template text: | |
timber.log.Timber.d($CONTENT$) | |
Variables: | |
CONTENT | |
Expression: | |
groovyScript("def params = _2.collect {it + ' = [\$' + it + ']'}.join(', ');return '\"' + _1 + '() called' + (params.empty ? '' : ' with: ' + params) + '\"'", kotlinFunctionName(), functionParameters()) | |
//timberm | |
fun foo(bar1: Int, bar2: String) { | |
Timber.d("foo() called with: bar1 = [$bar1], bar2 = [$bar2]") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment