Skip to content

Instantly share code, notes, and snippets.

@dtunctuncer
Last active May 21, 2019 13:30
Show Gist options
  • Save dtunctuncer/bdb5c45a5a871f8803171e235e4e92df to your computer and use it in GitHub Desktop.
Save dtunctuncer/bdb5c45a5a871f8803171e235e4e92df to your computer and use it in GitHub Desktop.
//Logging methods and parameters with Timber via Live Template
//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