Last active
April 11, 2020 20:26
-
-
Save zeeshanaslam78/6a361d111f19f6d51d29750ffe5f2834 to your computer and use it in GitHub Desktop.
logm template for Koltin in Android Studio
This file contains hidden or 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
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