use of com.orhanobut.logger.AndroidLogAdapter in project android-mdm-agent by flyve-mdm.
the class MDMAgent method onCreate.
/**
* Called when the application is starting before any activity, service or receiver objects have been created
*/
@Override
public void onCreate() {
super.onCreate();
instance = this;
UtilsCrash.configCrash(this, true);
try {
FormatStrategy formatStrategy = PrettyFormatStrategy.newBuilder().tag(// (Optional) Global tag for every log.
getPackageName()).build();
Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy));
} catch (Exception ex) {
ex.getStackTrace();
}
// ( 0 != ( getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE ) );
isDebuggable = true;
}
use of com.orhanobut.logger.AndroidLogAdapter in project LearnApp by YouCii.
the class App method onCreate.
@Override
public void onCreate() {
super.onCreate();
CrashHandler.getInstance().init(this);
// 启用LeakCanary, 正式发布时会自动失效
LeakCanary.install(this);
Logger.addLogAdapter(new AndroidLogAdapter());
initOkGo();
}
use of com.orhanobut.logger.AndroidLogAdapter in project ttdj by soonphe.
the class MainActivity method doBusiness.
@Override
public void doBusiness(Context mContext) {
if (Build.VERSION.SDK_INT >= 23) {
new RxPermissions(getContext()).request(Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.READ_PHONE_STATE, Manifest.permission.WRITE_EXTERNAL_STORAGE).subscribe(granded -> {
if (granded) {
} else {
Toast("请先授予应用相关权限");
mOperation.showBasicDialog(R.string.error, R.string.grant_permission, (dialog, which) -> {
// Intent intent = new Intent(Settings.ACTION_WIRELESS_SETTINGS); //飞行模式,无线网和网络设置界面
// 跳转位置服务界面
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(intent);
});
}
});
}
Logger.addLogAdapter(new AndroidLogAdapter());
Logger.d("___________________hello");
// CrashReport.initCrashReport(getApplicationContext());
// CrashReport.testJavaCrash();
// DaoMaster.DevOpenHelper devOpenHelper = new DaoMaster.DevOpenHelper(getApplicationContext(), "lenve.db", null);
// DaoMaster daoMaster = new DaoMaster(devOpenHelper.getWritableDb());
// DaoSession daoSession = daoMaster.newSession();
//
// VideoClassDao videoClassDao=daoSession.getVideoClassDao();
//
// VideoClass user = new VideoClass();
// videoClassDao.insert(user);
}
use of com.orhanobut.logger.AndroidLogAdapter in project 91Pop by DanteAndroid.
the class AppLogger method initLogger.
public static void initLogger() {
FormatStrategy formatStrategy = PrettyFormatStrategy.newBuilder().showThreadInfo(false).methodCount(0).methodOffset(5).build();
Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy) {
@Override
public boolean isLoggable(int priority, String tag) {
return BuildConfig.DEBUG;
}
});
}
use of com.orhanobut.logger.AndroidLogAdapter in project AndLang by wugemu.
the class BaseLangApplication method initData.
// private RefWatcher setupLeakCanary() {
// if (LeakCanary.isInAnalyzerProcess(this)) {
// return RefWatcher.DISABLED;
// }
// return LeakCanary.install(this);
// }
// public static RefWatcher getRefWatcher(Context context) {
// BaseLangApplication leakApplication = (BaseLangApplication) context.getApplicationContext();
// return leakApplication.refWatcher;
// }
private void initData() {
mApp = this;
// 程序错误日志信息收集
logDir = Environment.getExternalStorageDirectory().getPath() + "/sudian/crash/";
AppCrashHandler crashHandler = AppCrashHandler.getInstance();
crashHandler.init(getApplicationContext());
Logger.addLogAdapter(new AndroidLogAdapter());
initImageLoad();
LogUtil.e("0.0", "版本号:V" + VersionUtil.getVersionName(BaseLangApplication.this));
// 最大化防止应用crash 需要在清单中注册DebugSafeModeTipActivity
installCockroach();
}
Aggregations