-
Notifications
You must be signed in to change notification settings - Fork 2
/
AndroidLogKotlin.xml
59 lines (59 loc) · 4.21 KB
/
AndroidLogKotlin.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<templateSet group="AndroidLogKotlin">
<template name="logd" value="android.util.Log.d(TAG, "$KOTLIN_FUNCTION_NAME$: $content$")" description="Log.d(TAG, String)" toReformat="true" toShortenFQNames="true">
<variable name="KOTLIN_FUNCTION_NAME" expression="kotlinFunctionName()" defaultValue="" alwaysStopAt="false" />
<variable name="content" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="KOTLIN_STATEMENT" value="true" />
</context>
</template>
<template name="loge" value="android.util.Log.e(TAG, "$KOTLIN_FUNCTION_NAME$: $content$", $exception$)" description="Log.e(TAG, String, Exception)" toReformat="true" toShortenFQNames="true">
<variable name="KOTLIN_FUNCTION_NAME" expression="kotlinFunctionName()" defaultValue="" alwaysStopAt="false" />
<variable name="content" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="exception" expression="" defaultValue="e" alwaysStopAt="false" />
<context>
<option name="KOTLIN_STATEMENT" value="true" />
</context>
</template>
<template name="logi" value="android.util.Log.i(TAG, "$KOTLIN_FUNCTION_NAME$: $content$")" description="Log.i(TAG, String)" toReformat="true" toShortenFQNames="true">
<variable name="KOTLIN_FUNCTION_NAME" expression="kotlinFunctionName()" defaultValue="" alwaysStopAt="false" />
<variable name="content" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="KOTLIN_STATEMENT" value="true" />
</context>
</template>
<template name="logm" value="android.util.Log.d(TAG, $content$)" description="Log method name and its arguments" toReformat="true" toShortenFQNames="true">
<variable name="content" expression="groovyScript("def params = _2.collect {it + ' = [$' + it + ']'}.join(', '); return '\"' + _1 + '() called' + (params.empty ? '' : ' with: ' + params) + '\"'", kotlinFunctionName(), functionParameters())" defaultValue="" alwaysStopAt="false" />
<context>
<option name="KOTLIN_STATEMENT" value="true" />
</context>
</template>
<template name="logr" value="android.util.Log.d(TAG, "$KOTLIN_FUNCTION_NAME$() returned: $$$result$")" description="Log result of this method" toReformat="true" toShortenFQNames="true">
<variable name="KOTLIN_FUNCTION_NAME" expression="kotlinFunctionName()" defaultValue="" alwaysStopAt="false" />
<variable name="result" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="KOTLIN_STATEMENT" value="true" />
</context>
</template>
<template name="logt" value="companion object { private const val TAG = "$kotlinClassName$" }" description="A companion object containing a logtag with your current classname" toReformat="true" toShortenFQNames="true">
<variable name="kotlinClassName" expression="groovyScript("_1.take(Math.min(23, _1.length()));", kotlinClassName())" defaultValue="" alwaysStopAt="true" />
<context>
<option name="KOTLIN_CLASS" value="true" />
</context>
</template>
<template name="logw" value="android.util.Log.w(TAG, "$KOTLIN_FUNCTION_NAME$: $content$", $exception$)" description="Log.w(TAG, String, Exception)" toReformat="true" toShortenFQNames="true">
<variable name="KOTLIN_FUNCTION_NAME" expression="kotlinFunctionName()" defaultValue="" alwaysStopAt="false" />
<variable name="content" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="exception" expression="" defaultValue="e" alwaysStopAt="false" />
<context>
<option name="KOTLIN_STATEMENT" value="true" />
</context>
</template>
<template name="wtf" value="android.util.Log.wtf(TAG, "$KOTLIN_FUNCTION_NAME$: $content$", $exception$)" description="Log.wtf(TAG, String, Exception)" toReformat="true" toShortenFQNames="true">
<variable name="KOTLIN_FUNCTION_NAME" expression="kotlinFunctionName()" defaultValue="" alwaysStopAt="false" />
<variable name="content" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="exception" expression="" defaultValue="e" alwaysStopAt="false" />
<context>
<option name="KOTLIN_STATEMENT" value="true" />
</context>
</template>
</templateSet>