修改测试程序compileSdkVersion 版本 以及删除无用类
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
defaultConfig {
|
||||
applicationId "com.zhidao.adas.client"
|
||||
minSdkVersion 21
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.zhidao.adas.client.log;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
|
||||
//保存的log
|
||||
public class LogModel {
|
||||
|
||||
public interface ACTION {
|
||||
String SEND = "发送";
|
||||
String RECEIVE = "接收";
|
||||
String PARSE = "解析";
|
||||
}
|
||||
|
||||
public long id;
|
||||
public int op_code;//发送:Mask 接收:数据帧类型
|
||||
public String action;//log标签
|
||||
public String data;//log数据
|
||||
public String time;
|
||||
|
||||
public LogModel() {
|
||||
}
|
||||
|
||||
public LogModel(String action, int op_code, String data) {
|
||||
this.action = action;
|
||||
this.op_code = op_code;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
||||
public int getColor() {
|
||||
if (TextUtils.isEmpty(action)) {
|
||||
return Color.parseColor("#871f78");
|
||||
}
|
||||
switch (action) {
|
||||
case ACTION.SEND:
|
||||
// return 0xFA8072;
|
||||
return Color.parseColor("#FA8072");
|
||||
case ACTION.RECEIVE:
|
||||
// return 0xDCDCDC;
|
||||
return Color.parseColor("#FF00FF");
|
||||
case ACTION.PARSE:
|
||||
// return 0xDCDCDC;
|
||||
return Color.parseColor("#228B22");
|
||||
default:
|
||||
// return 0xFFFFFF;
|
||||
return Color.parseColor("#871f78");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ public class LogSave {
|
||||
private static final String ROOT_PATH = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "IPCMonitoring" + File.separator;//程序外部存储跟目录
|
||||
private static final String LOG_FILE_NAME = "data%s.log";//文件名称
|
||||
private volatile static LogSave INSTANCE;
|
||||
private static final long MAX_CAPACITY = 2 * 1024 * 1024L;//单文件最大存储容量 kb
|
||||
private static final long MAX_CAPACITY = 5 * 1024 * 1024L;//单文件最大存储容量 kb
|
||||
private final LinkedBlockingQueue<String> queue;
|
||||
private BufferedWriter buff = null;
|
||||
private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.getDefault());
|
||||
@@ -99,8 +99,6 @@ public class LogSave {
|
||||
if (isLogSwitch) {
|
||||
long nowTime = System.currentTimeMillis();
|
||||
String time = sdf.format(new Date(nowTime));
|
||||
// L.i(TAG, "time=" + time);
|
||||
data = data.replace("\n", "");
|
||||
String builder = time + " [action]:" + action + " [data]:" + data;
|
||||
queue.add(builder);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user