change the callerlogger

This commit is contained in:
zhongchao
2022-03-14 21:50:11 +08:00
parent e19ff59a89
commit 6102e55ed3
1315 changed files with 4162 additions and 61965 deletions

View File

@@ -3,8 +3,8 @@ package com.mogo.eagle.core.function.carcorder.service
import android.content.Intent
import android.hardware.usb.UsbDevice
import android.os.IBinder
import android.util.Log
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_CORDER
import com.mogo.usbcamera.UVCCameraHelper
import com.serenegiant.usb.IFrameCallback
import com.serenegiant.usb.USBMonitor
@@ -51,7 +51,7 @@ class CarcorderService : BaseService() {
override fun onCreate() {
super.onCreate()
if (DEBUG) {
Logger.d(TAG, "onCreate……")
CallerLogger.d("$M_CORDER$TAG", "onCreate……")
}
if (mUSBMonitor == null) {
mUSBMonitor = USBMonitor(applicationContext, mOnDeviceConnectListener)
@@ -63,7 +63,7 @@ class CarcorderService : BaseService() {
override fun onDestroy() {
super.onDestroy()
if (DEBUG) Log.d(TAG, "onDestroy:")
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "onDestroy:")
if (mUSBMonitor != null) {
mUSBMonitor!!.unregister()
mUSBMonitor = null
@@ -80,14 +80,14 @@ class CarcorderService : BaseService() {
}
override fun onRebind(intent: Intent) {
if (DEBUG) Log.d(TAG, "onRebind:$intent")
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "onRebind:$intent")
}
override fun onUnbind(intent: Intent): Boolean {
if (DEBUG) Log.d(TAG, "onUnbind:$intent")
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "onUnbind:$intent")
if (DEBUG) Log.d(TAG, "onUnbind:finished")
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "onUnbind:finished")
return true
}
@@ -102,25 +102,25 @@ class CarcorderService : BaseService() {
*/
private val mOnDeviceConnectListener: OnDeviceConnectListener = object : OnDeviceConnectListener {
override fun onAttach(device: UsbDevice) {
if (DEBUG) Log.d(TAG, "OnDeviceConnectListener#onAttach:${device.deviceName}---mDeviceList:${mDeviceList?.size}")
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "OnDeviceConnectListener#onAttach:${device.deviceName}---mDeviceList:${mDeviceList?.size}")
mUSBMonitor!!.requestPermission(device)
}
override fun onConnect(device: UsbDevice, ctrlBlock: UsbControlBlock, createNew: Boolean) {
if (DEBUG) Log.d(TAG, "OnDeviceConnectListener#onConnect:${device.deviceName}")
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "OnDeviceConnectListener#onConnect:${device.deviceName}")
openCamera(device, ctrlBlock, createNew)
}
override fun onDisconnect(device: UsbDevice, ctrlBlock: UsbControlBlock) {
if (DEBUG) Log.d(TAG, "OnDeviceConnectListener#onDisconnect:${device.deviceName}")
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "OnDeviceConnectListener#onDisconnect:${device.deviceName}")
}
override fun onDettach(device: UsbDevice) {
if (DEBUG) Log.d(TAG, "OnDeviceConnectListener#onDettach:${device.deviceName}")
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "OnDeviceConnectListener#onDettach:${device.deviceName}")
}
override fun onCancel(device: UsbDevice) {
if (DEBUG) Log.d(TAG, "OnDeviceConnectListener#onCancel:${device.deviceName}")
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "OnDeviceConnectListener#onCancel:${device.deviceName}")
}
}
@@ -132,7 +132,7 @@ class CarcorderService : BaseService() {
mUVCCamera = UVCCamera()
mUVCCamera!!.open(ctrlBlock)
mUVCCamera!!.setStatusCallback { statusClass, event, selector, statusAttribute, data ->
if (DEBUG) Log.d(TAG, "IStatusCallback#onStatus(statusClass=${statusClass},event=${event},selector=${selector},statusAttribute=${statusAttribute},data=${data})")
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "IStatusCallback#onStatus(statusClass=${statusClass},event=${event},selector=${selector},statusAttribute=${statusAttribute},data=${data})")
}
try {
@@ -156,7 +156,7 @@ class CarcorderService : BaseService() {
* 视频帧回掉
*/
private val mIFrameCallback = IFrameCallback { frame ->
if (DEBUG) Log.d(TAG, "IFrameCallback#onFrame:${frame}")
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "IFrameCallback#onFrame:${frame}")
}
}

View File

@@ -2,8 +2,8 @@ package com.mogo.eagle.core.function.carcorder.service
import android.content.Intent
import android.os.IBinder
import android.util.Log
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_CORDER
import com.serenegiant.usb.common.BaseService
/**
@@ -17,14 +17,14 @@ class LivePushService : BaseService() {
override fun onCreate() {
super.onCreate()
if (DEBUG) {
Logger.d(TAG, "onCreate……")
CallerLogger.d("$M_CORDER$TAG", "onCreate……")
}
}
override fun onDestroy() {
super.onDestroy()
if (DEBUG) Log.d(TAG, "onDestroy:")
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "onDestroy:")
}
@@ -38,14 +38,14 @@ class LivePushService : BaseService() {
}
override fun onRebind(intent: Intent) {
if (DEBUG) Log.d(TAG, "onRebind:$intent")
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "onRebind:$intent")
}
override fun onUnbind(intent: Intent): Boolean {
if (DEBUG) Log.d(TAG, "onUnbind:$intent")
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "onUnbind:$intent")
if (DEBUG) Log.d(TAG, "onUnbind:finished")
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "onUnbind:finished")
return true
}