-
Notifications
You must be signed in to change notification settings - Fork 2
/
AndroidLogKotlin.xml
110 lines (110 loc) · 8.41 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<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="logdt" value="android.util.Log.d(TAG, Thread.currentThread().name + " ### " + "$KOTLIN_FUNCTION_NAME$: $content$")" description="Log.d(TAG, Thread + 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="loget" value="android.util.Log.e(TAG, Thread.currentThread().name + " ### " + "$KOTLIN_FUNCTION_NAME$: $content$", $exception$)" description="Log.e(TAG, Thread + 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="logit" value="android.util.Log.i(TAG, Thread.currentThread().name + " ### " + "$KOTLIN_FUNCTION_NAME$: $content$")" description="Log.i(TAG, Thread + 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="logmt" value="android.util.Log.d(TAG, Thread.currentThread().name + " ### " + $content$)" description="Log thread, 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="logrt" value="android.util.Log.d(TAG, Thread.currentThread().name + " ### " + "$KOTLIN_FUNCTION_NAME$() returned: " + $result$)" description="Log thread and result of this method" toReformat="true" toShortenFQNames="true">
<variable name="KOTLIN_FUNCTION_NAME" expression="kotlinFunctionName()" defaultValue="" alwaysStopAt="false" />
<variable name="result" expression="variableOfType(methodReturnType())" 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="logwt" value="android.util.Log.w(TAG, Thread.currentThread().name + " ### " + "$KOTLIN_FUNCTION_NAME$: $content$", $exception$)" description="Log.w(TAG, Thread + 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>
<template name="wtft" value="android.util.Log.wtf(TAG, Thread.currentThread().name + " ### " + "$KOTLIN_FUNCTION_NAME$: $content$", $exception$)" description="Log.wtf(TAG, Thread + 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>