-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathStepTracker.java
More file actions
56 lines (54 loc) · 1.58 KB
/
StepTracker.java
File metadata and controls
56 lines (54 loc) · 1.58 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
package common.base.utils;
/**
* ******************(^_^)***********************<br>
* User: fee(QQ/WeiXin:1176610771)<br>
* Date: 2019/4/11<br>
* Time: 16:51<br>
* <P>DESC:
* 运行步骤的步次tracker
* </p>
* ******************(^_^)***********************
*/
public class StepTracker {
private static int curStep;
private static final String TAG = "StepTracker";
private static void trackStep(String stepTag, String logMsg,int logLevel) {
curStep++;
if (CheckUtil.isEmpty(stepTag)) {
stepTag = TAG;
}
if (logMsg == null) {
logMsg = "";
}
logMsg += " curStep = " + curStep;
switch (logLevel) {
case 1:
CommonLog.i(stepTag, logMsg);
break;
case 2:
CommonLog.w(stepTag,logMsg);
break;
case 3:
CommonLog.e(stepTag,logMsg);
break;
case 4:
CommonLog.d(stepTag, logMsg);
break;
default:
CommonLog.i(stepTag, logMsg);
break;
}
}
public static void trackStepLogW(String stepTag, String logMsg) {
trackStep(stepTag,logMsg,2);
}
public static void trackStepLogD(String stepTag, String logMsg) {
trackStep(stepTag,logMsg,4);
}
public static void trackStepLogI(String stepTag, String logMsg) {
trackStep(stepTag,logMsg,1);
}
public static void trackStepLogE(String stepTag, String logMsg) {
trackStep(stepTag,logMsg,3);
}
}