doum
6 天以前 2b287056e2f59518888d05a1bbc7e5a55fbd84d5
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
package com.example.datalibrary.utils;
 
import android.util.Log;
public class LogUtils {
 
    private static boolean isDebug = false;
 
    public static void setIsDebug(boolean isDebug) {
        LogUtils.isDebug = isDebug;
    }
 
    public static int v(String tag, String msg) {
        if (isDebug) {
            return Log.v(tag, msg);
        } else {
            return -1;
        }
    }
 
    public static int d(String tag, String msg) {
        if (isDebug) {
            return Log.d(tag, msg);
        } else {
            return -1;
        }
    }
 
    public static int i(String tag, String msg) {
        if (isDebug) {
            return Log.i(tag, msg);
        } else {
            return -1;
        }
    }
 
    public static int w(String tag, String msg) {
        if (isDebug) {
            return Log.w(tag, msg);
        } else {
            return -1;
        }
    }
 
    public static int e(String tag, String msg) {
        if (isDebug) {
            return Log.e(tag, msg);
        } else {
            return -1;
        }
    }
}