Files
MoGoEagleEye/app/src/main/java/com/mogo/launcher/MogoApplication.java
2023-06-15 16:30:47 +08:00

57 lines
1.9 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package com.mogo.launcher;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.function.api.devatools.strict.IStrictModeProvider;
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
import com.mogo.eagle.core.function.call.startup.CallerStartUpManager;
import com.mogo.eagle.core.function.main.MainMoGoApplication;
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
import com.mogo.eagle.core.utilcode.util.SharedPrefs;
import com.mogo.launcher.crash.CrashSystem;
import com.mogo.launcher.startup.ARouterStartUp;
import com.mogo.launcher.startup.ConfigStartUp;
import com.zhjt.service.chain.TraceNodeCore;
/**
* @author congtaowang
* @since 2019-12-18
* <p>
* Launcher application
*/
public class MogoApplication extends MainMoGoApplication {
@Override
public void onCreate() {
TraceNodeCore.Companion.getTraceNodeCore().setDebugMode(true); //todo
ARouterStartUp.init(this);
ConfigStartUp.init(this);
tryEnableStrictMode();
super.onCreate();
}
private void tryEnableStrictMode() {
IStrictModeProvider strict = CallerDevaToolsManager.INSTANCE.strict();
if (DebugConfig.isDebug() && strict != null) {
boolean enabled = SharedPrefs.getInstance(this).getBoolean("MOGO_STRICT_MODE_ENABLED", false);
Logger.e("StrictMode", "isEnabled:" + enabled);
if (enabled) {
strict.enable();
}
}
}
@Override
protected void initCrashConfig() {
CrashSystem crashSystem = CrashSystem.getInstance(this);
crashSystem.init();
//设置debug模式日志不上传
crashSystem.setDebug(BuildConfig.DEBUG);
}
@Override
protected void initLogConfig() {
super.initLogConfig();
Logger.init(BuildConfig.DEBUG ? LogLevel.DEBUG : LogLevel.OFF);
}
}