整理代码控制日志打印

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2022-01-27 18:21:22 +08:00
parent 09b17b37ef
commit 81e76f2dd4
8 changed files with 13 additions and 91 deletions

View File

@@ -114,7 +114,7 @@ ext {
obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3",
mogoobu : 'com.zhidao.support.obu:mogoobu:1.0.0.19',
mogoami : 'com.zhidao.support.obu.ami:mogoami:1.0.0.10',
adasHigh : 'com.zhidao.support.adas:high:1.2.1.2_bate14',
adasHigh : 'com.zhidao.support.adas:high:1.2.1.2_bate16',
// google
googlezxing : "com.google.zxing:core:3.3.3",

View File

@@ -960,7 +960,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
*/
override fun showTurnLight(light: Int) {
if (isOpenTurnlight) {
Log.d("liyz", "showTurnLight light = $light")
//Log.d("liyz", "showTurnLight light = $light")
turnLightView.setTurnLight(light)
}
}

View File

@@ -88,14 +88,6 @@ public final class NetConfig {
return this;
}
public synchronized HostnameVerifier getHostnameVerifier() {
return hostnameVerifier;
}
public synchronized NetConfig setHostnameVerifier( HostnameVerifier hostnameVerifier ) {
this.hostnameVerifier = hostnameVerifier;
return this;
}
public synchronized NetConfig setSignaturePrefix( String prefix ) {
this.signaturePrefix = prefix;
@@ -106,24 +98,6 @@ public final class NetConfig {
return signaturePrefix;
}
public synchronized Set< Interceptor > getInterceptors() {
return interceptors;
}
public synchronized NetConfig addInterceptor( Interceptor interceptor ) {
interceptors.add( interceptor );
return this;
}
public synchronized Set< Interceptor > getNetworkInterceptors() {
return networkInterceptors;
}
public synchronized NetConfig addNetworkInterceptor( Interceptor networkInterceptor ) {
networkInterceptors.add( networkInterceptor );
return this;
}
public synchronized NetConfig setPublicParams( Map< String, Object > publicParams ) {
this.publicParams = publicParams;
return this;

View File

@@ -50,29 +50,4 @@ public class MogoHttpDns implements IMogoHttpDns {
}
// @Override
// public List<InetAddress> lookup(String hostname) throws UnknownHostException {
// String cacheIp = httpDnsHelper.getHttpDnsCachedAddress(HTTP_DNS_ADDRESS_TYPE_HTTP, hostname);
// Logger.d("MogoHttpDnsLook", "lookup host: " + hostname + " cacheIp: " + cacheIp);
// if (cacheIp == null || TextUtils.isEmpty(cacheIp)) {
// cacheIp = httpDnsHelper.getHttpDnsAddress(HttpDnsHelper.HTTP_DNS_TYPE_HTTP, hostname);
// Logger.d("MogoHttpDnsLook", "==== lookup host: " + hostname + " cacheIp: " + cacheIp);
// if (!TextUtils.isEmpty(cacheIp)) {
// String[] info = cacheIp.split(":");
// if (info.length > 1) {
// return Arrays.asList(InetAddress.getAllByName(info[0]));
// } else {
// return Arrays.asList(InetAddress.getAllByName(cacheIp));
// }
// }
// return Collections.emptyList();
// }
// String[] info = cacheIp.split(":");
// if (info.length > 1) {
// return Arrays.asList(InetAddress.getAllByName(info[0]));
// } else {
// return Arrays.asList(InetAddress.getAllByName(cacheIp));
// }
// }
}

View File

@@ -142,7 +142,7 @@ public abstract class AbsMogoApplication extends Application {
ThreadPoolService.execute(() -> {
//初始化网络配置
NetConfigUtils.init(sApis);
NetConfigUtils.init();
// 初始化埋点
AnalyticsUtils.init(sApp);
if (DebugConfig.getCarMachineType() == CAR_MACHINE_TYPE_SELF_INNOVATE) {

View File

@@ -1,19 +1,11 @@
package com.mogo.commons.network;
import com.mogo.aicloud.services.httpdns.IMogoHttpDns;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.storage.SpStorage;
import com.mogo.eagle.core.network.AllAllowedHostnameVerifier;
import com.mogo.eagle.core.network.Constants;
import com.mogo.eagle.core.network.NetConfig;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
import javax.net.ssl.SSLContext;
import okhttp3.Request;
import static com.mogo.aicloud.services.httpdns.HttpDnsConst.HTTP_DNS_ADDRESS_TYPE_HTTP;
/**
* @author xuxinchao
* @description 网络配置工具
@@ -23,9 +15,8 @@ public class NetConfigUtils {
/**
* 网络配置初始化
* @param iMogoHttpDns Http DNS转换实现
*/
public static void init(IMogoHttpDns iMogoHttpDns){
public static void init() {
try {
SSLContext sc = NetConfig.getSslContext();
NetConfig.instance().setSslContext(sc);
@@ -34,24 +25,6 @@ public class NetConfigUtils {
}
NetConfig.instance().setSignaturePrefix(Constants.SIGN_PREFIX)
.setPublicParams(ParamsUtil.getStaticParams())
.setHostnameVerifier(new AllAllowedHostnameVerifier())
.addNetworkInterceptor(chain -> {
Request original = chain.request();
Request request = original.newBuilder()
.header("token", SpStorage.getTicket())
.method(original.method(), original.body())
.build();
return chain.proceed(request);
})
// 增加域名->域名的转换方式暂时去掉httpdns方式
.addInterceptor(chain -> {
Request request = chain.request();
String path = request.url().encodedPath();
String host = "http://" + iMogoHttpDns.syncGetHttpDns(request.url().host().replace("http://", "").replace("https://", ""), HTTP_DNS_ADDRESS_TYPE_HTTP, true);
String url = host + path;
Logger.d("DomainExchange", "oriHost: " + request.url().host() + " newHost: " + host + " \r\n newUrl: " + url);
return chain.proceed(request.newBuilder().url(url).build());
})
.setLoggable(DebugConfig.isDebug());
}

View File

@@ -63,21 +63,21 @@ SERVICE_CHAIN_VERSION=1.0.43
LOGLIB_VERSION=1.1.18
######## MogoAiCloudSDK Version ########
# 网络请求
MOGO_NETWORK_VERSION=1.3.17
MOGO_NETWORK_VERSION=1.3.18
# 鉴权
MOGO_PASSPORT_VERSION=1.3.17
MOGO_PASSPORT_VERSION=1.3.18
# 常链接
MOGO_SOCKET_VERSION=1.3.17
MOGO_SOCKET_VERSION=1.3.18
# 数据采集
MOGO_REALTIME_VERSION=1.3.17
MOGO_REALTIME_VERSION=1.3.18
# 探路,道路事件发布,获取
MOGO_TANLU_VERSION=1.3.17
MOGO_TANLU_VERSION=1.3.18
# 直播推流
MOGO_LIVE_VERSION=1.3.17
MOGO_LIVE_VERSION=1.3.18
# 直播拉流
MOGO_TRAFFICLIVE_VERSION=1.3.17
MOGO_TRAFFICLIVE_VERSION=1.3.18
# 定位服务
MOGO_LOCATION_VERSION=1.3.17
MOGO_LOCATION_VERSION=1.3.18
######## MogoAiCloudSDK Version ########
# 自研地图
MAP_SDK_VERSION=2.0.0.23

View File

@@ -74,7 +74,7 @@ public class DispatchServiceModel {
@Override
public void onNext(BaseData o) {
super.onNext(o);
Logger.d(TAG, "uploadAutopilotStatus success");
//Logger.d(TAG, "uploadAutopilotStatus success");
}
@Override