fix bug of scene module tag problem

This commit is contained in:
zhongchao
2022-04-01 19:57:16 +08:00
parent 52ea6f98dc
commit a4e9b95d99
14 changed files with 126 additions and 89 deletions

View File

@@ -5,11 +5,13 @@ import com.mogo.eagle.core.data.deva.scene.SceneModule
import com.mogo.eagle.core.data.deva.scene.SceneModuleTAG import com.mogo.eagle.core.data.deva.scene.SceneModuleTAG
import com.mogo.eagle.core.data.deva.scene.SceneTAG import com.mogo.eagle.core.data.deva.scene.SceneTAG
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.Scene.Companion.scene import com.mogo.eagle.core.utilcode.mogo.logger.scene.Scene.Companion.scene
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_NETWORK import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_NETWORK
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OLD_ROUTE import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OLD_ROUTE
@@ -17,7 +19,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_TAXI import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_TAXI
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_TAXI_P import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_TAXI_P
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneLogCache
//1. SceneLogCache增加模块名称提供场景需要 //1. SceneLogCache增加模块名称提供场景需要
@@ -31,6 +32,7 @@ class SceneManager {
private const val HMI = "HMI" private const val HMI = "HMI"
private const val OBU = "OBU" private const val OBU = "OBU"
private const val V2X = "V2X" private const val V2X = "V2X"
private const val MAP = "MAP"
private const val ROUTE = "ROUTE" private const val ROUTE = "ROUTE"
private const val NET = "NET" private const val NET = "NET"
private const val BUS = "BUS" private const val BUS = "BUS"
@@ -49,10 +51,11 @@ class SceneManager {
init { init {
//过滤所需条件 //过滤所需条件
sceneModuleTAG.map[ADAS] = SceneModule(true, M_ADAS_IMPL) sceneModuleTAG.map[ADAS] = SceneModule(true, M_ADAS_IMPL)
sceneModuleTAG.map[DEVA] = SceneModule(true, M_DEVA) sceneModuleTAG.map[DEVA] = SceneModule(false, M_DEVA)
sceneModuleTAG.map[HMI] = SceneModule(true, M_HMI) sceneModuleTAG.map[HMI] = SceneModule(false, M_HMI)
sceneModuleTAG.map[OBU] = SceneModule(false, M_OBU) sceneModuleTAG.map[OBU] = SceneModule(false, M_OBU)
sceneModuleTAG.map[V2X] = SceneModule(true, M_V2X) sceneModuleTAG.map[V2X] = SceneModule(false, M_V2X)
sceneModuleTAG.map[MAP] = SceneModule(false, M_MAP)
sceneModuleTAG.map[ROUTE] = SceneModule(true, M_OLD_ROUTE) sceneModuleTAG.map[ROUTE] = SceneModule(true, M_OLD_ROUTE)
sceneModuleTAG.map[NET] = SceneModule(true, M_NETWORK) sceneModuleTAG.map[NET] = SceneModule(true, M_NETWORK)
sceneModuleTAG.map[BUS] = SceneModule(true, M_BUS) sceneModuleTAG.map[BUS] = SceneModule(true, M_BUS)
@@ -62,9 +65,34 @@ class SceneManager {
sceneLogTAG.map[TAXI] = SceneTAG(false) sceneLogTAG.map[TAXI] = SceneTAG(false)
sceneLogTAG.map[BUS] = SceneTAG(false) sceneLogTAG.map[BUS] = SceneTAG(false)
//默认未创建的符合scene tag首次初始化logger=true
scene.addChangeListener { change ->
Logger.i("emArrow","scene change : $change")
sceneModuleTAG.map.iterator().forEach { map ->
val sceneModule = map.value
sceneModule.name?.let {
if (change == sceneModule.name) {
sceneModule.log = true
map.setValue(sceneModule)
}
}
}
//call back
CallerDevaToolsListenerManager.invokeDevaToolsModuleLogChanges(sceneModuleTAG.map)
}
} }
fun getModuleLogTAG(): MutableMap<String, SceneModule> { fun getModuleLogTAG(): MutableMap<String, SceneModule> {
val sceneCache = scene.getSceneCache()
sceneModuleTAG.map.forEach { map ->
map.value.name?.let { module ->
val sceneLogCache = sceneCache[module]
sceneLogCache?.let {
map.value.log = it.logger
}
}
}
return sceneModuleTAG.map return sceneModuleTAG.map
} }

View File

@@ -1109,7 +1109,8 @@ class DebugSettingView @JvmOverloads constructor(
} }
override fun moduleLogChanged(moduleTag: MutableMap<String, SceneModule>) { override fun moduleLogChanged(moduleTag: MutableMap<String, SceneModule>) {
//todo 模块日志 tag 发生变化,需要更新对应 UI //模块日志 tag 发生变化,需要更新对应 UI
setLogCheckedChangeListener()
} }
override fun upgradeVersionUrls(urls: Map<String, String>?) { override fun upgradeVersionUrls(urls: Map<String, String>?) {
@@ -1512,14 +1513,6 @@ class DebugSettingView @JvmOverloads constructor(
* 自动驾驶状态回调 * 自动驾驶状态回调
*/ */
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) { override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
// mAutoPilotStatusInfo?.let {
// if(it.pilotmode != autoPilotStatusInfo.pilotmode){
// when(autoPilotStatusInfo.pilotmode){
// 0 -> AIAssist.getInstance(context).speakTTSVoice("退出自动驾驶")
// 1 -> AIAssist.getInstance(context).speakTTSVoice("开始自动驾驶")
// }
// }
// }
mAutoPilotStatusInfo = autoPilotStatusInfo mAutoPilotStatusInfo = autoPilotStatusInfo
AppConfigInfo.isConnectAutopilot = autoPilotStatusInfo.connectStatus AppConfigInfo.isConnectAutopilot = autoPilotStatusInfo.connectStatus

View File

@@ -1,6 +1,6 @@
package com.mogo.eagle.core.function.main; package com.mogo.eagle.core.function.main;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAIN; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
import android.location.Location; import android.location.Location;
import android.view.MotionEvent; import android.view.MotionEvent;
@@ -61,7 +61,7 @@ public class EventDispatchCenter implements
try { try {
return listener.onMarkerClicked(marker); return listener.onMarkerClicked(marker);
} catch (Exception e) { } catch (Exception e) {
CallerLogger.INSTANCE.e(M_MAIN + TAG, "onMarkerClicked error : " + e); CallerLogger.INSTANCE.e(M_HMI + TAG, "onMarkerClicked error : " + e);
} }
} }
return false; return false;
@@ -78,7 +78,7 @@ public class EventDispatchCenter implements
return listener.onStaticMarkerClicked(marker); return listener.onStaticMarkerClicked(marker);
} }
} catch (Exception e) { } catch (Exception e) {
CallerLogger.INSTANCE.e(M_MAIN + TAG, "onStaticMarkerClicked error : " + e); CallerLogger.INSTANCE.e(M_HMI + TAG, "onStaticMarkerClicked error : " + e);
} }
return false; return false;
} }
@@ -129,7 +129,7 @@ public class EventDispatchCenter implements
try { try {
listener.onMapLoaded(); listener.onMapLoaded();
} catch (Exception e) { } catch (Exception e) {
CallerLogger.INSTANCE.e(M_MAIN + TAG, "onMapLoaded error : " + e); CallerLogger.INSTANCE.e(M_HMI + TAG, "onMapLoaded error : " + e);
} }
} }
} }
@@ -147,7 +147,7 @@ public class EventDispatchCenter implements
try { try {
listener.onTouch(motionEvent); listener.onTouch(motionEvent);
} catch (Exception e) { } catch (Exception e) {
CallerLogger.INSTANCE.e(M_MAIN + TAG, "onTouch error : " + e); CallerLogger.INSTANCE.e(M_HMI + TAG, "onTouch error : " + e);
} }
} }
} }
@@ -165,7 +165,7 @@ public class EventDispatchCenter implements
try { try {
listener.onPOIClick(poi); listener.onPOIClick(poi);
} catch (Exception e) { } catch (Exception e) {
CallerLogger.INSTANCE.e(M_MAIN + TAG, "onPOIClick error : " + e); CallerLogger.INSTANCE.e(M_HMI + TAG, "onPOIClick error : " + e);
} }
} }
} }
@@ -183,7 +183,7 @@ public class EventDispatchCenter implements
try { try {
listener.onMapClick(latLng); listener.onMapClick(latLng);
} catch (Exception e) { } catch (Exception e) {
CallerLogger.INSTANCE.e(M_MAIN + TAG, "onMapClick error : " + e); CallerLogger.INSTANCE.e(M_HMI + TAG, "onMapClick error : " + e);
} }
} }
} }
@@ -201,7 +201,7 @@ public class EventDispatchCenter implements
try { try {
listener.onLockMap(isLock); listener.onLockMap(isLock);
} catch (Exception e) { } catch (Exception e) {
CallerLogger.INSTANCE.e(M_MAIN + TAG, "onLockMap error : " + e); CallerLogger.INSTANCE.e(M_HMI + TAG, "onLockMap error : " + e);
} }
} }
} }
@@ -219,7 +219,7 @@ public class EventDispatchCenter implements
try { try {
listener.onMapModeChanged(ui); listener.onMapModeChanged(ui);
} catch (Exception e) { } catch (Exception e) {
CallerLogger.INSTANCE.e(M_MAIN + TAG, "onMapModeChanged error :" + e); CallerLogger.INSTANCE.e(M_HMI + TAG, "onMapModeChanged error :" + e);
} }
} }
} }
@@ -237,7 +237,7 @@ public class EventDispatchCenter implements
try { try {
listener.onMapVisualAngleChanged(visualAngleMode); listener.onMapVisualAngleChanged(visualAngleMode);
} catch (Exception e) { } catch (Exception e) {
CallerLogger.INSTANCE.e(M_MAIN + TAG, "onMapVisualAngleChanged error : " + e); CallerLogger.INSTANCE.e(M_HMI + TAG, "onMapVisualAngleChanged error : " + e);
} }
} }
} }
@@ -255,7 +255,7 @@ public class EventDispatchCenter implements
try { try {
listener.onMapChanged(location, zoom, tilt, bearing); listener.onMapChanged(location, zoom, tilt, bearing);
} catch (Exception e) { } catch (Exception e) {
CallerLogger.INSTANCE.e(M_MAIN + TAG, "onMapChanged error :" + e); CallerLogger.INSTANCE.e(M_HMI + TAG, "onMapChanged error :" + e);
} }
} }
} }
@@ -274,7 +274,7 @@ public class EventDispatchCenter implements
try { try {
listener.onLocationChanged(location); listener.onLocationChanged(location);
} catch (Exception e) { } catch (Exception e) {
CallerLogger.INSTANCE.e(M_MAIN + TAG, "onLocationChanged error : " + e); CallerLogger.INSTANCE.e(M_HMI + TAG, "onLocationChanged error : " + e);
} }
} }
} }

View File

@@ -1,7 +1,7 @@
package com.mogo.eagle.core.function.main; package com.mogo.eagle.core.function.main;
import static com.mogo.eagle.core.function.main.MainPresenter.MOGO_PERMISSION_REQUEST_CODE; import static com.mogo.eagle.core.function.main.MainPresenter.MOGO_PERMISSION_REQUEST_CODE;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAIN; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
@@ -158,14 +158,14 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
// 过滤掉异常启动时间 // 过滤掉异常启动时间
if (coldStartTime < 50000) { if (coldStartTime < 50000) {
// 上传冷启动时间coldStartTime // 上传冷启动时间coldStartTime
CallerLogger.INSTANCE.i(M_MAIN + TAG, "coldStartTime:" + coldStartTime); CallerLogger.INSTANCE.i(M_HMI + TAG, "coldStartTime:" + coldStartTime);
properties.put("app_launch_coldStartTime", coldStartTime); properties.put("app_launch_coldStartTime", coldStartTime);
} }
} else if (hotStartTime > 0) { } else if (hotStartTime > 0) {
// 过滤掉异常启动时间 // 过滤掉异常启动时间
if (hotStartTime < 30000) { if (hotStartTime < 30000) {
// 上传热启动时间hotStartTime // 上传热启动时间hotStartTime
CallerLogger.INSTANCE.i(M_MAIN + TAG, "hotStartTime:" + hotStartTime); CallerLogger.INSTANCE.i(M_HMI + TAG, "hotStartTime:" + hotStartTime);
properties.put("app_launch_hotStartTime", hotStartTime); properties.put("app_launch_hotStartTime", hotStartTime);
} }
} }
@@ -195,7 +195,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
if (DebugConfig.isMapBased()) { if (DebugConfig.isMapBased()) {
EventDispatchCenter.getInstance().setMapLoadedCallback(() -> { EventDispatchCenter.getInstance().setMapLoadedCallback(() -> {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "map loaded." + Thread.currentThread().getName()); CallerLogger.INSTANCE.d(M_HMI + TAG, "map loaded." + Thread.currentThread().getName());
// 延时加载其他模块 // 延时加载其他模块
getWindow().getDecorView().postDelayed(() -> { getWindow().getDecorView().postDelayed(() -> {
loadOthersModules(); loadOthersModules();
@@ -205,7 +205,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode(TAG, true); MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode(TAG, true);
MogoMapListenerHandler.getInstance().onMapModeChanged(EnumMapUI.Type_VR); MogoMapListenerHandler.getInstance().onMapModeChanged(EnumMapUI.Type_VR);
}, 1000); }, 1000);
CallerLogger.INSTANCE.i(M_MAIN + TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms"); CallerLogger.INSTANCE.i(M_HMI + TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms");
}); });
loadFunctionMapView(); loadFunctionMapView();
} else { } else {
@@ -263,7 +263,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
@Override @Override
public void loadFunctionFragment() { public void loadFunctionFragment() {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "loadFunctionFragment……"); CallerLogger.INSTANCE.d(M_HMI + TAG, "loadFunctionFragment……");
// 加载 HMI 图层 // 加载 HMI 图层
BaseFragment fragmentHdMap = (BaseFragment) ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_HMI).navigation(); BaseFragment fragmentHdMap = (BaseFragment) ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_HMI).navigation();
addFragment(fragmentHdMap, fragmentHdMap.getTagName(), R.id.module_main_id_waring_fragment); addFragment(fragmentHdMap, fragmentHdMap.getTagName(), R.id.module_main_id_waring_fragment);
@@ -369,7 +369,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
if (mapUIController != null) { if (mapUIController != null) {
mapUIController.destroy(); mapUIController.destroy();
} }
CallerLogger.INSTANCE.d(M_MAIN + TAG, "destroy."); CallerLogger.INSTANCE.d(M_HMI + TAG, "destroy.");
ContextHolderUtil.releaseContext(); ContextHolderUtil.releaseContext();
MogoModulesManager.getInstance().onDestroy(); MogoModulesManager.getInstance().onDestroy();
SchemeIntent.getInstance().clear(); SchemeIntent.getInstance().clear();
@@ -434,7 +434,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
fragment = newFragment; fragment = newFragment;
} }
if (fragment == null) { if (fragment == null) {
CallerLogger.INSTANCE.e(M_MAIN + TAG, "add fragment fail cause fragment == null, container is " + ResourcesHelper.getResNameById(getApplicationContext(), containerId)); CallerLogger.INSTANCE.e(M_HMI + TAG, "add fragment fail cause fragment == null, container is " + ResourcesHelper.getResNameById(getApplicationContext(), containerId));
return; return;
} }
getSupportFragmentManager().beginTransaction() getSupportFragmentManager().beginTransaction()

View File

@@ -1,6 +1,6 @@
package com.mogo.eagle.core.function.main; package com.mogo.eagle.core.function.main;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAIN; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
@@ -32,7 +32,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
DebugConfig.setNeedRequestUserInfo(true); DebugConfig.setNeedRequestUserInfo(true);
CallerLogger.INSTANCE.i(M_MAIN + TAG, "onCreate"); CallerLogger.INSTANCE.i(M_HMI + TAG, "onCreate");
} }
@Override @Override
@@ -70,7 +70,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
@Override @Override
protected void loadOthersModules() { protected void loadOthersModules() {
super.loadOthersModules(); super.loadOthersModules();
CallerLogger.INSTANCE.d(M_MAIN + TAG, "loadOthersModules"); CallerLogger.INSTANCE.d(M_HMI + TAG, "loadOthersModules");
loadOCHModule(); loadOCHModule();
} }

View File

@@ -1,6 +1,6 @@
package com.mogo.eagle.core.function.main; package com.mogo.eagle.core.function.main;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAIN; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
import android.content.Context; import android.content.Context;
import android.os.Process; import android.os.Process;
@@ -74,7 +74,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
@Override @Override
protected boolean shouldInit() { protected boolean shouldInit() {
CallerLogger.INSTANCE.w(M_MAIN + TAG, "evaluate shouldInit() with: " + ProcessUtils.getProcessName(Process.myPid())); CallerLogger.INSTANCE.w(M_HMI + TAG, "evaluate shouldInit() with: " + ProcessUtils.getProcessName(Process.myPid()));
return ProcessUtils.isMainProcess(this); return ProcessUtils.isMainProcess(this);
} }
@@ -228,7 +228,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
// e.printStackTrace(); // e.printStackTrace();
httpDnsSimpleLocation = new HttpDnsSimpleLocation("010", 1, 1); httpDnsSimpleLocation = new HttpDnsSimpleLocation("010", 1, 1);
} }
//CallerLogger.INSTANCE.d(M_MAIN + TAG, "使用缓存GPS信息" + httpDnsSimpleLocation); //CallerLogger.INSTANCE.d(M_HMI + TAG, "使用缓存GPS信息" + httpDnsSimpleLocation);
} }
return httpDnsSimpleLocation; return httpDnsSimpleLocation;
}); });
@@ -238,7 +238,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
new IMoGoTokenCallback() { new IMoGoTokenCallback() {
@Override @Override
public void onTokenGot(String token, String sn) { public void onTokenGot(String token, String sn) {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "onTokenGot "); CallerLogger.INSTANCE.d(M_HMI + TAG, "onTokenGot ");
clientConfig.setToken(token); clientConfig.setToken(token);
// 异步初始化NetConfig // 异步初始化NetConfig
asyncInit(); asyncInit();
@@ -250,7 +250,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
@Override @Override
public void onError(int code, String msg) { public void onError(int code, String msg) {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "初始化MogoAiCloudSdk failed ,reason : " + msg + " , 未能开启长链服务和初始化Modules服务"); CallerLogger.INSTANCE.d(M_HMI + TAG, "初始化MogoAiCloudSdk failed ,reason : " + msg + " , 未能开启长链服务和初始化Modules服务");
} }
} }
); );
@@ -279,26 +279,26 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
} }
private void startSocketService() { private void startSocketService() {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "startSocketService"); CallerLogger.INSTANCE.d(M_HMI + TAG, "startSocketService");
MogoLocation location = CallerMapUIServiceManager.INSTANCE.getSingletonLocationClient(getApp()).getLastKnowLocation(); MogoLocation location = CallerMapUIServiceManager.INSTANCE.getSingletonLocationClient(getApp()).getLastKnowLocation();
// 关闭长链服务 // 关闭长链服务
MogoAiCloudSocketManager.getInstance(getApplicationContext()).destroy(); MogoAiCloudSocketManager.getInstance(getApplicationContext()).destroy();
MogoAiCloudSocketManager.getInstance(getApplicationContext()).registerLifecycleListener(10020, new IMogoLifecycleListener() { MogoAiCloudSocketManager.getInstance(getApplicationContext()).registerLifecycleListener(10020, new IMogoLifecycleListener() {
@Override @Override
public void onConnectFailure() { public void onConnectFailure() {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "socket-onConnectFailure"); CallerLogger.INSTANCE.d(M_HMI + TAG, "socket-onConnectFailure");
DebugConfig.setDownloadSnapshot(false); DebugConfig.setDownloadSnapshot(false);
} }
@Override @Override
public void onConnectSuccess() { public void onConnectSuccess() {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "socket-onConnectSuccess"); CallerLogger.INSTANCE.d(M_HMI + TAG, "socket-onConnectSuccess");
DebugConfig.setDownloadSnapshot(true); DebugConfig.setDownloadSnapshot(true);
} }
@Override @Override
public void onConnectLost() { public void onConnectLost() {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "socket-onConnectLost"); CallerLogger.INSTANCE.d(M_HMI + TAG, "socket-onConnectLost");
DebugConfig.setDownloadSnapshot(false); DebugConfig.setDownloadSnapshot(false);
} }
}); });
@@ -315,7 +315,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
} }
private void initModules() { private void initModules() {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "initModules"); CallerLogger.INSTANCE.d(M_HMI + TAG, "initModules");
// 初始化 bugly 升级 // 初始化 bugly 升级
MogoModulePaths.addBaseModule(new MogoModule(UpgradeReportConstants.PATH, UpgradeReportConstants.NAME)); MogoModulePaths.addBaseModule(new MogoModule(UpgradeReportConstants.PATH, UpgradeReportConstants.NAME));
// 初始化 apm 日志采集 // 初始化 apm 日志采集
@@ -352,7 +352,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER, "MoGoMapDataCollector")); MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER, "MoGoMapDataCollector"));
} }
CallerLogger.INSTANCE.i(M_MAIN + TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms"); CallerLogger.INSTANCE.i(M_HMI + TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms");
} }
@Override @Override

View File

@@ -1,6 +1,6 @@
package com.mogo.eagle.core.function.main; package com.mogo.eagle.core.function.main;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAIN; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
@@ -119,7 +119,7 @@ public class SchemeIntent implements IMogoStatusChangedListener {
handleSwitch2Action(target); handleSwitch2Action(target);
break; break;
case "/main/share": case "/main/share":
CallerLogger.INSTANCE.d(M_MAIN + TAG, "收到打开分享框的scheme准备打开分享框"); CallerLogger.INSTANCE.d(M_HMI + TAG, "收到打开分享框的scheme准备打开分享框");
// Map<String, Object> properties = new HashMap<>(); // Map<String, Object> properties = new HashMap<>();
// properties.put("from", "1"); // properties.put("from", "1");
// mApis.getAnalyticsApi().track("v2x_share_click", properties); // mApis.getAnalyticsApi().track("v2x_share_click", properties);
@@ -147,7 +147,7 @@ public class SchemeIntent implements IMogoStatusChangedListener {
if (TextUtils.isEmpty(type)) { if (TextUtils.isEmpty(type)) {
return; return;
} }
CallerLogger.INSTANCE.d(M_MAIN + TAG, "语音打开事件面板" + type); CallerLogger.INSTANCE.d(M_HMI + TAG, "语音打开事件面板" + type);
switch (type) { switch (type) {
case TYPE_LAUNCH: case TYPE_LAUNCH:
handleLaunchIntent(target); handleLaunchIntent(target);
@@ -180,7 +180,7 @@ public class SchemeIntent implements IMogoStatusChangedListener {
* 语音打开事件面板 * 语音打开事件面板
*/ */
private void handleShowEventPanel(int item) { private void handleShowEventPanel(int item) {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "语音打开事件面板" + item); CallerLogger.INSTANCE.d(M_HMI + TAG, "语音打开事件面板" + item);
//mApis.getEventPanelManager().showPanelWithSelectedItem(item); //mApis.getEventPanelManager().showPanelWithSelectedItem(item);
} }

View File

@@ -1,6 +1,6 @@
package com.mogo.eagle.core.function.main.cards; package com.mogo.eagle.core.function.main.cards;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAIN; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
import android.app.Application; import android.app.Application;
import android.content.Context; import android.content.Context;
@@ -89,7 +89,7 @@ public class MogoModulesManager implements MogoModulesHandler {
final List<MogoModule> modules = MogoModulePaths.getModules(); final List<MogoModule> modules = MogoModulePaths.getModules();
if (modules != null && !modules.isEmpty()) { if (modules != null && !modules.isEmpty()) {
for (MogoModule module : modules) { for (MogoModule module : modules) {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "module.getPath():" + module.getPath() + " name: " + module.getName()); CallerLogger.INSTANCE.d(M_HMI + TAG, "module.getPath():" + module.getPath() + " name: " + module.getName());
IMogoModuleProvider provider = load(module.getPath()); IMogoModuleProvider provider = load(module.getPath());
if (provider != null) { if (provider != null) {
mModuleProviders.put(module, provider); mModuleProviders.put(module, provider);
@@ -104,7 +104,7 @@ public class MogoModulesManager implements MogoModulesHandler {
final List<MogoModule> modules = MogoModulePaths.getModuleFunctions(); final List<MogoModule> modules = MogoModulePaths.getModuleFunctions();
if (modules != null && !modules.isEmpty()) { if (modules != null && !modules.isEmpty()) {
for (MogoModule module : modules) { for (MogoModule module : modules) {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "module.getPath():" + module.getPath() + " name: " + module.getName()); CallerLogger.INSTANCE.d(M_HMI + TAG, "module.getPath():" + module.getPath() + " name: " + module.getName());
IMoGoFunctionProvider provider = loadFunction(module.getPath()); IMoGoFunctionProvider provider = loadFunction(module.getPath());
if (provider != null) { if (provider != null) {
mModuleFunctionProviders.put(module, provider); mModuleFunctionProviders.put(module, provider);
@@ -119,7 +119,7 @@ public class MogoModulesManager implements MogoModulesHandler {
final List<MogoModule> modules = MogoModulePaths.getModuleFunctionServers(); final List<MogoModule> modules = MogoModulePaths.getModuleFunctionServers();
if (modules != null && !modules.isEmpty()) { if (modules != null && !modules.isEmpty()) {
for (MogoModule module : modules) { for (MogoModule module : modules) {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "module.getPath():" + module.getPath() + " name: " + module.getName()); CallerLogger.INSTANCE.d(M_HMI + TAG, "module.getPath():" + module.getPath() + " name: " + module.getName());
IMoGoFunctionServerProvider provider = loadFunctionServer(module.getPath()); IMoGoFunctionServerProvider provider = loadFunctionServer(module.getPath());
if (provider != null) { if (provider != null) {
mModuleFunctionServerProviders.put(module, provider); mModuleFunctionServerProviders.put(module, provider);
@@ -136,7 +136,7 @@ public class MogoModulesManager implements MogoModulesHandler {
if (baseModule == null) { if (baseModule == null) {
continue; continue;
} }
CallerLogger.INSTANCE.d(M_MAIN + TAG, "加载基本模块 : " + baseModule.getPath()); CallerLogger.INSTANCE.d(M_HMI + TAG, "加载基本模块 : " + baseModule.getPath());
loadBaseProvider(baseModule.getPath()); loadBaseProvider(baseModule.getPath());
} }
} }
@@ -180,7 +180,7 @@ public class MogoModulesManager implements MogoModulesHandler {
private void addFragment(IMogoModuleProvider provider, int containerId) { private void addFragment(IMogoModuleProvider provider, int containerId) {
if (provider == null) { if (provider == null) {
CallerLogger.INSTANCE.e(M_MAIN + TAG, "add fragment fail cause provider == null, container is " + ResourcesHelper.getResNameById(getApplicationContext(), containerId)); CallerLogger.INSTANCE.e(M_HMI + TAG, "add fragment fail cause provider == null, container is " + ResourcesHelper.getResNameById(getApplicationContext(), containerId));
return; return;
} }
Fragment fragment = null; Fragment fragment = null;
@@ -189,7 +189,7 @@ public class MogoModulesManager implements MogoModulesHandler {
fragment = provider.createFragment(getContext(), null); fragment = provider.createFragment(getContext(), null);
} }
if (fragment == null) { if (fragment == null) {
CallerLogger.INSTANCE.e(M_MAIN + TAG, "add fragment fail cause fragment == null, container is " + ResourcesHelper.getResNameById(getApplicationContext(), containerId)); CallerLogger.INSTANCE.e(M_HMI + TAG, "add fragment fail cause fragment == null, container is " + ResourcesHelper.getResNameById(getApplicationContext(), containerId));
return; return;
} }
mActivity.getSupportFragmentManager().beginTransaction() mActivity.getSupportFragmentManager().beginTransaction()
@@ -205,10 +205,10 @@ public class MogoModulesManager implements MogoModulesHandler {
if (modules != null) { if (modules != null) {
for (IMogoModuleProvider module : modules) { for (IMogoModuleProvider module : modules) {
try { try {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "destroy module: " + module.getModuleName()); CallerLogger.INSTANCE.d(M_HMI + TAG, "destroy module: " + module.getModuleName());
module.onDestroy(); module.onDestroy();
} catch (Exception e) { } catch (Exception e) {
CallerLogger.INSTANCE.e(M_MAIN + TAG, e + " onDestroy"); CallerLogger.INSTANCE.e(M_HMI + TAG, e + " onDestroy");
} }
} }
} }
@@ -222,10 +222,10 @@ public class MogoModulesManager implements MogoModulesHandler {
if (modules != null) { if (modules != null) {
for (IMoGoFunctionProvider module : modules) { for (IMoGoFunctionProvider module : modules) {
try { try {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "destroy module: " + module.getFunctionName()); CallerLogger.INSTANCE.d(M_HMI + TAG, "destroy module: " + module.getFunctionName());
module.onDestroy(); module.onDestroy();
} catch (Exception e) { } catch (Exception e) {
CallerLogger.INSTANCE.e(M_MAIN + TAG, e + " onDestroy"); CallerLogger.INSTANCE.e(M_HMI + TAG, e + " onDestroy");
} }
} }
} }
@@ -239,10 +239,10 @@ public class MogoModulesManager implements MogoModulesHandler {
if (modules != null) { if (modules != null) {
for (IMoGoFunctionServerProvider module : modules) { for (IMoGoFunctionServerProvider module : modules) {
try { try {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "destroy module: " + module.getFunctionName()); CallerLogger.INSTANCE.d(M_HMI + TAG, "destroy module: " + module.getFunctionName());
module.onDestroy(); module.onDestroy();
} catch (Exception e) { } catch (Exception e) {
CallerLogger.INSTANCE.e(M_MAIN + TAG, e + " onDestroy"); CallerLogger.INSTANCE.e(M_HMI + TAG, e + " onDestroy");
} }
} }
} }

View File

@@ -1,7 +1,7 @@
package com.mogo.eagle.core.function.main.monitoring; package com.mogo.eagle.core.function.main.monitoring;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAIN; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
import android.content.Context; import android.content.Context;
import android.os.Handler; import android.os.Handler;
@@ -35,10 +35,10 @@ public class VehicleMonitoring implements Handler.Callback {
public void vehicleCheck() { public void vehicleCheck() {
if (AutopilotStatus == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) { if (AutopilotStatus == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "自动驾驶中..."); CallerLogger.INSTANCE.d(M_HMI + TAG, "自动驾驶中...");
mHandler.sendEmptyMessageDelayed(AutopilotStatus, AUTO_CHECK_STATUS_DELAY); mHandler.sendEmptyMessageDelayed(AutopilotStatus, AUTO_CHECK_STATUS_DELAY);
} else { } else {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "非自动驾驶状态"); CallerLogger.INSTANCE.d(M_HMI + TAG, "非自动驾驶状态");
//非自动驾驶状态只展示一次 //非自动驾驶状态只展示一次
mHandler.sendEmptyMessageDelayed(AutopilotStatus, MANUAL_CHECK_STATUS_DELAY); mHandler.sendEmptyMessageDelayed(AutopilotStatus, MANUAL_CHECK_STATUS_DELAY);
} }
@@ -63,7 +63,7 @@ public class VehicleMonitoring implements Handler.Callback {
} }
public void vehicleMonitor() { public void vehicleMonitor() {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "vehicleMonitor"); CallerLogger.INSTANCE.d(M_HMI + TAG, "vehicleMonitor");
CallerCheckManager.checkMonitor(mContext); CallerCheckManager.checkMonitor(mContext);
} }

View File

@@ -1,6 +1,6 @@
package com.mogo.eagle.core.function.main.service; package com.mogo.eagle.core.function.main.service;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAIN; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
import android.app.Service; import android.app.Service;
import android.content.Intent; import android.content.Intent;
@@ -44,11 +44,11 @@ class MogoMainService extends Service implements IMogoLocationListener {
@Override @Override
public void onCreate() { public void onCreate() {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "基本服务启动"); CallerLogger.INSTANCE.d(M_HMI + TAG, "基本服务启动");
mServiceApis = MogoApisHandler.getInstance().getApis(); mServiceApis = MogoApisHandler.getInstance().getApis();
initAndStartLocation(); initAndStartLocation();
UiThreadHandler.postDelayed(() -> { UiThreadHandler.postDelayed(() -> {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "5秒已过启动基础服务……"); CallerLogger.INSTANCE.d(M_HMI + TAG, "5秒已过启动基础服务……");
loadBaseModules(); loadBaseModules();
initGpsSimulatorListener(); initGpsSimulatorListener();
HdMapBuildConfig.isMapLoaded = true; HdMapBuildConfig.isMapLoaded = true;
@@ -71,7 +71,7 @@ class MogoMainService extends Service implements IMogoLocationListener {
} }
private void initAndStartLocation() { private void initAndStartLocation() {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "开始定位"); CallerLogger.INSTANCE.d(M_HMI + TAG, "开始定位");
mLocationClient = CallerMapUIServiceManager.INSTANCE.getSingletonLocationClient(AbsMogoApplication.getApp()); mLocationClient = CallerMapUIServiceManager.INSTANCE.getSingletonLocationClient(AbsMogoApplication.getApp());
if (mLocationClient != null) { if (mLocationClient != null) {
mLocationClient.addLocationListener(this); mLocationClient.addLocationListener(this);
@@ -83,12 +83,12 @@ class MogoMainService extends Service implements IMogoLocationListener {
* 初始化自车定位监听 * 初始化自车定位监听
*/ */
private void initGpsSimulatorListener() { private void initGpsSimulatorListener() {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "注册自车位置监听"); CallerLogger.INSTANCE.d(M_HMI + TAG, "注册自车位置监听");
MogoCarLocationChangedListenerRegister.getInstance().registerCarLocationChangedListener(EventDispatchCenter.getInstance()); MogoCarLocationChangedListenerRegister.getInstance().registerCarLocationChangedListener(EventDispatchCenter.getInstance());
} }
private void loadBaseModules() { private void loadBaseModules() {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "加载基本模块"); CallerLogger.INSTANCE.d(M_HMI + TAG, "加载基本模块");
MogoModulesManager.getInstance().loadBaseModule(); MogoModulesManager.getInstance().loadBaseModule();
} }

View File

@@ -1,6 +1,6 @@
package com.mogo.eagle.core.function.main.windowview; package com.mogo.eagle.core.function.main.windowview;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAIN; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@@ -62,7 +62,7 @@ public class FloatingViewHandler {
} }
if (sFloatingLayout == null) { if (sFloatingLayout == null) {
CallerLogger.INSTANCE.e(M_MAIN + TAG, "no floating frame. "); CallerLogger.INSTANCE.e(M_HMI + TAG, "no floating frame. ");
return; return;
} }
@@ -85,7 +85,7 @@ public class FloatingViewHandler {
} }
if (sFloatingLayout == null) { if (sFloatingLayout == null) {
CallerLogger.INSTANCE.e(M_MAIN + TAG, "no floating frame. "); CallerLogger.INSTANCE.e(M_HMI + TAG, "no floating frame. ");
return; return;
} }
sFloatingLayout.addView(view, params); sFloatingLayout.addView(view, params);
@@ -106,18 +106,18 @@ public class FloatingViewHandler {
} }
if (sFloatingLayout == null) { if (sFloatingLayout == null) {
CallerLogger.INSTANCE.e(M_MAIN + TAG, "no floating frame. "); CallerLogger.INSTANCE.e(M_HMI + TAG, "no floating frame. ");
return; return;
} }
if (sView == view) { if (sView == view) {
CallerLogger.INSTANCE.w(M_MAIN + TAG, "改布局已添加且没有移除,不操作"); CallerLogger.INSTANCE.w(M_HMI + TAG, "改布局已添加且没有移除,不操作");
return; return;
} }
if (sView != null) { if (sView != null) {
if (priority < sPriority) { if (priority < sPriority) {
CallerLogger.INSTANCE.w(M_MAIN + TAG, "过滤低优先级布局"); CallerLogger.INSTANCE.w(M_HMI + TAG, "过滤低优先级布局");
return; return;
} }
sFloatingLayout.removeView(sView); sFloatingLayout.removeView(sView);
@@ -144,18 +144,18 @@ public class FloatingViewHandler {
} }
if (sFloatingLayout == null) { if (sFloatingLayout == null) {
CallerLogger.INSTANCE.e(M_MAIN + TAG, "no floating frame. "); CallerLogger.INSTANCE.e(M_HMI + TAG, "no floating frame. ");
return; return;
} }
if (sView == view) { if (sView == view) {
CallerLogger.INSTANCE.w(M_MAIN + TAG, "改布局已添加且没有移除,不操作"); CallerLogger.INSTANCE.w(M_HMI + TAG, "改布局已添加且没有移除,不操作");
return; return;
} }
if (sView != null) { if (sView != null) {
if (priority < sPriority) { if (priority < sPriority) {
CallerLogger.INSTANCE.w(M_MAIN + TAG, "过滤低优先级布局"); CallerLogger.INSTANCE.w(M_HMI + TAG, "过滤低优先级布局");
return; return;
} }
sFloatingLayout.removeView(sView); sFloatingLayout.removeView(sView);

View File

@@ -1,15 +1,18 @@
package com.mogo.eagle.core.utilcode.mogo.logger.scene package com.mogo.eagle.core.utilcode.mogo.logger.scene
import android.util.ArrayMap import android.util.ArrayMap
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_NETWORK import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_NETWORK
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OLD_ROUTE import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OLD_ROUTE
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OTHER import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OTHER
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_TAXI import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_TAXI
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_TAXI_P import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_TAXI_P
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
import java.util.* import java.util.*
/** /**
@@ -35,11 +38,17 @@ class Scene {
val adasMap = SceneLogCache(mutableMapOf(), true) val adasMap = SceneLogCache(mutableMapOf(), true)
sceneCache[M_ADAS_IMPL] = adasMap sceneCache[M_ADAS_IMPL] = adasMap
//初始化deva //初始化deva
val devaMap = SceneLogCache(mutableMapOf(), true) val devaMap = SceneLogCache(mutableMapOf(), false)
sceneCache[M_DEVA] = devaMap sceneCache[M_DEVA] = devaMap
//初始化hmi //初始化hmi
val hmiMap = SceneLogCache(mutableMapOf(), true) val hmiMap = SceneLogCache(mutableMapOf(), false)
sceneCache[M_HMI] = hmiMap sceneCache[M_HMI] = hmiMap
//初始化v2x
val v2xMap = SceneLogCache(mutableMapOf(), false)
sceneCache[M_V2X] = v2xMap
//初始化map
val map = SceneLogCache(mutableMapOf(), false)
sceneCache[M_MAP] = map
//初始化路径规划 //初始化路径规划
val routeMap = SceneLogCache(mutableMapOf(), true) val routeMap = SceneLogCache(mutableMapOf(), true)
sceneCache[M_OLD_ROUTE] = routeMap sceneCache[M_OLD_ROUTE] = routeMap
@@ -58,6 +67,12 @@ class Scene {
} }
private var changed: ((String) -> Unit)? = null
fun addChangeListener(changed:(String) -> Unit){
this.changed = changed
}
fun getSceneCache(): MutableMap<String, SceneLogCache> { fun getSceneCache(): MutableMap<String, SceneLogCache> {
return sceneCache return sceneCache
} }
@@ -76,7 +91,6 @@ class Scene {
//前置收口 //前置收口
private fun canLog(): Boolean { private fun canLog(): Boolean {
return true return true
} }
@@ -97,18 +111,21 @@ class Scene {
if (moduleName.isNullOrEmpty()) { if (moduleName.isNullOrEmpty()) {
val otherLogCache = sceneCache[M_OTHER] val otherLogCache = sceneCache[M_OTHER]
otherLogCache!!.tagMap!![tag] = true otherLogCache!!.tagMap!![tag] = true
otherLogCache.logger = false
return otherLogCache.logger return otherLogCache.logger
} }
//此处存在用户自定义方式,可根据过滤找到对应不符合标准的模块 //此处存在用户自定义方式,可根据过滤找到对应不符合标准的模块
var logCache = sceneCache["$moduleName-"] var logCache = sceneCache["$moduleName-"]
if (logCache == null) { if (logCache == null) {
Logger.i("emArrow","tag : $tag , module : $moduleName , sceneCache : $sceneCache")
logCache = SceneLogCache(mutableMapOf(), true) logCache = SceneLogCache(mutableMapOf(), true)
businessName?.let { businessName?.let {
logCache.tagMap!![it] = true logCache.tagMap!![it] = true
} }
changed?.invoke("$moduleName-")
} }
sceneCache[moduleName] = logCache sceneCache["$moduleName-"] = logCache
return logCache.logger return logCache.logger
} }
} }

View File

@@ -15,7 +15,6 @@ class SceneConstant {
const val M_DEVA = "M_DEVA-" const val M_DEVA = "M_DEVA-"
const val M_DISPATCH = "M_DISPATCH-" const val M_DISPATCH = "M_DISPATCH-"
const val M_HMI = "M_HMI-" const val M_HMI = "M_HMI-"
const val M_MAIN = "M_MAIN-"
const val M_MAP = "M_MAP-" const val M_MAP = "M_MAP-"
const val M_MONITOR = "M_MONITOR-" const val M_MONITOR = "M_MONITOR-"
const val M_NOTICE = "M_NOTICE-" const val M_NOTICE = "M_NOTICE-"

View File

@@ -180,7 +180,7 @@ public abstract class AbsMogoApplication extends Application {
return; return;
} }
if (!dnsCacheIp.equals(cacheIp)) { if (!dnsCacheIp.equals(cacheIp)) {
CallerLogger.INSTANCE.d("TEST-SOCKET", "获取缓存Dns IP : " + dnsCacheIp + " , 原缓存 IP " + cacheIp); CallerLogger.INSTANCE.d("TEST_SOCKET", "获取缓存Dns IP : " + dnsCacheIp + " , 原缓存 IP " + cacheIp);
socketTTL(); socketTTL();
this.cacheIp = dnsCacheIp; this.cacheIp = dnsCacheIp;
} }