-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogger.kt
More file actions
76 lines (62 loc) · 1.82 KB
/
Logger.kt
File metadata and controls
76 lines (62 loc) · 1.82 KB
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
package com.example.app
import android.util.Log
import com.example.app.BuildConfig
object Logger {
private const val APP_TAG = "APP NAME : "
private var isEnabled : Boolean = BuildConfig.DEBUG
fun v(tag : String, message : String) {
if (isEnabled) {
Log.v(APP_TAG + tag, message)
}
}
fun v(tag : String, message : String, throwable: Throwable?) {
if (isEnabled) {
Log.v(APP_TAG + tag, message, throwable)
}
}
fun d(tag : String, message : String) {
if (isEnabled) {
Log.d(APP_TAG + tag, message)
}
}
fun d(tag : String, message : String, throwable: Throwable?) {
if (isEnabled) {
Log.d(APP_TAG + tag, message, throwable)
}
}
fun i(tag : String, message : String) {
if (isEnabled) {
Log.i(APP_TAG + tag, message)
}
}
fun i(tag : String, message : String, throwable: Throwable?) {
if (isEnabled) {
Log.i(APP_TAG + tag, message, throwable)
}
}
fun w(tag : String, message : String) {
if (isEnabled) {
Log.w(APP_TAG + tag, message)
}
}
fun w(tag : String, throwable: Throwable?) {
if (isEnabled) {
Log.w(APP_TAG + tag, throwable)
}
}
fun w(tag : String, message : String, throwable: Throwable?) {
if (isEnabled) {
Log.w(APP_TAG + tag, message, throwable)
}
}
fun e(tag : String, message : String) {
if (isEnabled) {
Log.e(APP_TAG + tag, message)
}
}
fun e(tag : String, message : String, throwable: Throwable?) {
if (isEnabled) {
Log.e(APP_TAG + tag, message, throwable)
}
}
}