[6.0.0] log
This commit is contained in:
@@ -6,7 +6,6 @@ import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.os.Handler
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -19,6 +18,8 @@ import com.mogo.eagle.core.data.deva.badcase.SubBagEntity
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.zhidao.loglib.download.DownloadManager
|
||||
@@ -116,7 +117,7 @@ class BadCaseManagerView @JvmOverloads constructor(
|
||||
if(bagManagerList.size>0){
|
||||
bagManagerEntity.reqType = 3
|
||||
bagManagerEntity.keyReq = bagManagerList[0].key
|
||||
Log.i("sendBagManagerCmd","bagManagerEntity.keyReq="+bagManagerEntity.keyReq)
|
||||
CallerLogger.i(M_DEVA+"sendBagManagerCmd","bagManagerEntity.keyReq="+bagManagerEntity.keyReq)
|
||||
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
||||
|
||||
bagUploadDialog = BagUploadDialog(context)
|
||||
@@ -237,24 +238,24 @@ class BadCaseManagerView @JvmOverloads constructor(
|
||||
override fun onBagManagerResult(bagManager: BagManagerOuterClass.BagManager) {
|
||||
super.onBagManagerResult(bagManager)
|
||||
UiThreadHandler.post {
|
||||
Log.i(TAG,"onBagManagerResult Start")
|
||||
Log.i(TAG,"keyReq="+bagManager.keyReq)
|
||||
Log.i(TAG,"reqType="+bagManager.reqType)
|
||||
Log.i(TAG,"uploadCosResp stat="+bagManager.uploadCosResp.stat)
|
||||
Log.i(TAG,"descReq description="+bagManager.descReq.description
|
||||
CallerLogger.i(M_DEVA + TAG,"onBagManagerResult Start")
|
||||
CallerLogger.i(M_DEVA + TAG,"keyReq="+bagManager.keyReq)
|
||||
CallerLogger.i(M_DEVA + TAG,"reqType="+bagManager.reqType)
|
||||
CallerLogger.i(M_DEVA + TAG,"uploadCosResp stat="+bagManager.uploadCosResp.stat)
|
||||
CallerLogger.i(M_DEVA + TAG,"descReq description="+bagManager.descReq.description
|
||||
+" audioUrl="+bagManager.descReq.audioUrl
|
||||
+" reportBI="+bagManager.descReq.reportBI
|
||||
+" hasAudio="+bagManager.descReq.hasAudio)
|
||||
for(logBag in bagManager.bagsInfoRespList){
|
||||
Log.i(TAG,"bagPath="+logBag.bagPath)
|
||||
Log.i(TAG,"timestamp="+logBag.timestamp)
|
||||
Log.i(TAG,"description="+logBag.description)
|
||||
Log.i(TAG,"key="+logBag.key)
|
||||
Log.i(TAG,"mergeStat="+logBag.mergeStat)
|
||||
Log.i(TAG,"totalSize="+logBag.totalSize)
|
||||
Log.i(TAG,"uploadStat="+logBag.uploadStat)
|
||||
CallerLogger.i(M_DEVA + TAG,"bagPath="+logBag.bagPath)
|
||||
CallerLogger.i(M_DEVA + TAG,"timestamp="+logBag.timestamp)
|
||||
CallerLogger.i(M_DEVA + TAG,"description="+logBag.description)
|
||||
CallerLogger.i(M_DEVA + TAG,"key="+logBag.key)
|
||||
CallerLogger.i(M_DEVA + TAG,"mergeStat="+logBag.mergeStat)
|
||||
CallerLogger.i(M_DEVA + TAG,"totalSize="+logBag.totalSize)
|
||||
CallerLogger.i(M_DEVA + TAG,"uploadStat="+logBag.uploadStat)
|
||||
}
|
||||
Log.i(TAG,"onBagManagerResult End")
|
||||
CallerLogger.i(M_DEVA + TAG,"onBagManagerResult End")
|
||||
|
||||
//获取空间使用信息
|
||||
if(bagManager.reqType == 1){
|
||||
@@ -367,7 +368,7 @@ class BadCaseManagerView @JvmOverloads constructor(
|
||||
//执行下一个上传Bag命令
|
||||
bagManagerEntity.reqType = 3
|
||||
bagManagerEntity.keyReq = bagManagerList[0].key
|
||||
Log.i("sendBagManagerCmd","bagManagerEntity.keyReq="+bagManagerEntity.keyReq)
|
||||
CallerLogger.i("sendBagManagerCmd","bagManagerEntity.keyReq="+bagManagerEntity.keyReq)
|
||||
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.record;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_DEVA;
|
||||
|
||||
import android.media.AudioRecord;
|
||||
import android.media.MediaRecorder;
|
||||
import android.os.Environment;
|
||||
@@ -164,8 +166,7 @@ public class RecordHelper {
|
||||
mp3EncodeThread = new Mp3EncodeThread(resultFile, bufferSize, currentConfig);
|
||||
mp3EncodeThread.start();
|
||||
} catch (Exception e) {
|
||||
// Log.e(e, TAG, e.getMessage());
|
||||
CallerLogger.INSTANCE.d("$M_DEVA$TAG", e.getMessage());
|
||||
CallerLogger.d(M_DEVA+TAG, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,14 +177,14 @@ public class RecordHelper {
|
||||
AudioRecordThread() {
|
||||
bufferSize = AudioRecord.getMinBufferSize(currentConfig.getSampleRate(),
|
||||
currentConfig.getChannelConfig(), currentConfig.getEncodingConfig()) * RECORD_AUDIO_BUFFER_TIMES;
|
||||
CallerLogger.INSTANCE.d("$M_DEVA$TAG", "record buffer size = %s", bufferSize);
|
||||
CallerLogger.d("$M_DEVA$TAG", "record buffer size = %s", bufferSize);
|
||||
audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC, currentConfig.getSampleRate(),
|
||||
currentConfig.getChannelConfig(), currentConfig.getEncodingConfig(), bufferSize);
|
||||
if (currentConfig.getFormat() == RecordConfig.RecordFormat.MP3) {
|
||||
if (mp3EncodeThread == null) {
|
||||
initMp3EncoderThread(bufferSize);
|
||||
} else {
|
||||
CallerLogger.INSTANCE.e("$M_DEVA$TAG", "mp3EncodeThread != null, 请检查代码");
|
||||
CallerLogger.e("$M_DEVA$TAG", "mp3EncodeThread != null, 请检查代码");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -205,7 +206,7 @@ public class RecordHelper {
|
||||
private void startPcmRecorder() {
|
||||
state = RecordState.RECORDING;
|
||||
notifyState();
|
||||
CallerLogger.INSTANCE.d("$M_DEVA$TAG", "开始录制 Pcm");
|
||||
CallerLogger.d("$M_DEVA$TAG", "开始录制 Pcm");
|
||||
FileOutputStream fos = null;
|
||||
try {
|
||||
fos = new FileOutputStream(tmpFile);
|
||||
@@ -223,7 +224,7 @@ public class RecordHelper {
|
||||
if (state == RecordState.STOP) {
|
||||
makeFile();
|
||||
} else {
|
||||
CallerLogger.INSTANCE.i("$M_DEVA$TAG", "暂停!");
|
||||
CallerLogger.i("$M_DEVA$TAG", "暂停!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
notifyError("录音失败");
|
||||
@@ -239,7 +240,7 @@ public class RecordHelper {
|
||||
if (state != RecordState.PAUSE) {
|
||||
state = RecordState.IDLE;
|
||||
notifyState();
|
||||
CallerLogger.INSTANCE.d("$M_DEVA$TAG", "录音结束");
|
||||
CallerLogger.d("$M_DEVA$TAG", "录音结束");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,7 +268,7 @@ public class RecordHelper {
|
||||
notifyState();
|
||||
stopMp3Encoded();
|
||||
} else {
|
||||
CallerLogger.INSTANCE.d("$M_DEVA$TAG", "暂停");
|
||||
CallerLogger.d("$M_DEVA$TAG", "暂停");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -282,7 +283,7 @@ public class RecordHelper {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
CallerLogger.INSTANCE.e("$M_DEVA$TAG", "mp3EncodeThread is null, 代码业务流程有误,请检查!! ");
|
||||
CallerLogger.e("$M_DEVA$TAG", "mp3EncodeThread is null, 代码业务流程有误,请检查!! ");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,7 +302,7 @@ public class RecordHelper {
|
||||
break;
|
||||
}
|
||||
notifyFinish();
|
||||
CallerLogger.INSTANCE.i("$M_DEVA$TAG", "录音完成! path: %s ; 大小:%s", resultFile.getAbsoluteFile(), resultFile.length());
|
||||
CallerLogger.i("$M_DEVA$TAG", "录音完成! path: %s ; 大小:%s", resultFile.getAbsoluteFile(), resultFile.length());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -353,7 +354,7 @@ public class RecordHelper {
|
||||
inputStream.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, e.getMessage());
|
||||
CallerLogger.e(M_DEVA + TAG, e.getMessage());
|
||||
return false;
|
||||
} finally {
|
||||
try {
|
||||
@@ -376,7 +377,7 @@ public class RecordHelper {
|
||||
|
||||
private String getFilePath(String fileName) {
|
||||
if (!FileUtils.createOrExistsDir(ROOT_PATH)) {
|
||||
CallerLogger.INSTANCE.w("$M_DEVA$TAG", "文件夹创建失败:%s", ROOT_PATH);
|
||||
CallerLogger.w("$M_DEVA$TAG", "文件夹创建失败:%s", ROOT_PATH);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -387,7 +388,7 @@ public class RecordHelper {
|
||||
|
||||
private String getTempFilePath() {
|
||||
if (!FileUtils.createOrExistsDir(TEMP_PATH)) {
|
||||
CallerLogger.INSTANCE.e("$M_DEVA$TAG", "文件夹创建失败:%s", TEMP_PATH);
|
||||
CallerLogger.e("$M_DEVA$TAG", "文件夹创建失败:%s", TEMP_PATH);
|
||||
}
|
||||
String fileName = String.format(Locale.getDefault(), "tmp_%s", FileUtils.getNowString(new SimpleDateFormat("yyyyMMddHHmmssSSS", Locale.SIMPLIFIED_CHINESE)));
|
||||
return String.format(Locale.getDefault(), "%s%s.pcm", TEMP_PATH, fileName);
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.record.mp3;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_DEVA;
|
||||
|
||||
import android.media.MediaExtractor;
|
||||
import android.media.MediaFormat;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.FileUtils;
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.record.RecordConfig;
|
||||
|
||||
@@ -34,7 +36,7 @@ public class Mp3Utils {
|
||||
long duration = mf.getLong(MediaFormat.KEY_DURATION) / 1000L;
|
||||
return duration;
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, e.getMessage());
|
||||
CallerLogger.e(M_DEVA +TAG, e.getMessage());
|
||||
} finally {
|
||||
if (mex != null) {
|
||||
mex.release();
|
||||
|
||||
Reference in New Issue
Block a user