Skip to content

Instantly share code, notes, and snippets.

@zeeshanaslam78
Last active April 11, 2020 20:26
Show Gist options
  • Save zeeshanaslam78/6a361d111f19f6d51d29750ffe5f2834 to your computer and use it in GitHub Desktop.
Save zeeshanaslam78/6a361d111f19f6d51d29750ffe5f2834 to your computer and use it in GitHub Desktop.
logm template for Koltin in Android Studio
Android Studio
Preferences -> Editor -> Live Templates
Under AndroidLog
Copy "logm" Tamplate or any
Paste Under Kotlin
Choose logm under Kotlin
Set the following values
Abbreviation: logm
Description: Log method name and its arguments
Template text:
timber.log.Timber.d($content$)
Edit variable -> Edit Template Variables
Name:
content
Expression:
groovyScript("def params = _2.collect {it + ' = [%s]'}.join(', '); return '\"' + _1 + '() called' + (params.empty ? '' : ' with: ' + params + ',') + '\"' + (_2.empty ? '' : ','+_2.join(','))", kotlinFunctionName(), functionParameters())
Default value:
leave it empty
Skip If defined:
Checked
Press "OK" "Apply" "OK"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment