From 67ccec51e47ca6e9d34a35a3d494c1ff5d333448 Mon Sep 17 00:00:00 2001 From: wangtao Date: Thu, 23 Mar 2023 11:22:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20ios=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=85=8D=E7=BD=AE=EF=BC=8C=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=AE=89=E5=8D=93=E6=97=A5=E5=BF=97=E7=AD=89=E7=BA=A7=E7=9A=84?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/finogeeks/mop/api/mop/InitSDKModule.java | 8 ++++---- ios/Classes/Api/MOP_initSDK.m | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/android/src/main/java/com/finogeeks/mop/api/mop/InitSDKModule.java b/android/src/main/java/com/finogeeks/mop/api/mop/InitSDKModule.java index e7029fe..fe11cdd 100644 --- a/android/src/main/java/com/finogeeks/mop/api/mop/InitSDKModule.java +++ b/android/src/main/java/com/finogeeks/mop/api/mop/InitSDKModule.java @@ -148,15 +148,15 @@ public class InitSDKModule extends BaseApi { } int logLevelIndex = (Integer) configMap.get("logLevel"); if (logLevelIndex == 0) { - configBuilder.setLogLevel(XLogLevel.LEVEL_VERBOSE); + configBuilder.setLogLevel(XLogLevel.LEVEL_ERROR); } else if (logLevelIndex == 1) { - configBuilder.setLogLevel(XLogLevel.LEVEL_DEBUG); + configBuilder.setLogLevel(XLogLevel.LEVEL_WARNING); } else if (logLevelIndex == 2) { configBuilder.setLogLevel(XLogLevel.LEVEL_INFO); } else if (logLevelIndex == 3) { - configBuilder.setLogLevel(XLogLevel.LEVEL_WARNING); + configBuilder.setLogLevel(XLogLevel.LEVEL_DEBUG); } else if (logLevelIndex == 4) { - configBuilder.setLogLevel(XLogLevel.LEVEL_ERROR); + configBuilder.setLogLevel(XLogLevel.LEVEL_VERBOSE); } else if (logLevelIndex == 5) { configBuilder.setLogLevel(XLogLevel.LEVEL_NONE); } diff --git a/ios/Classes/Api/MOP_initSDK.m b/ios/Classes/Api/MOP_initSDK.m index 0f6cd2d..57c0157 100644 --- a/ios/Classes/Api/MOP_initSDK.m +++ b/ios/Classes/Api/MOP_initSDK.m @@ -250,8 +250,10 @@ failure(@"初始化失败"); return; } + FATLogLevel logLevel = [self.config[@"logLevel"] integerValue]; + NSString *logDir = self.config[@"logDir"]; // [[FATExtClient sharedClient] fat_prepareExtensionApis]; - [[FATClient sharedClient].logManager initLogWithLogDir:nil logLevel:FATLogLevelVerbose consoleLog:YES]; + [[FATClient sharedClient].logManager initLogWithLogDir:logDir logLevel:logLevel consoleLog:YES]; [[FATClient sharedClient] setEnableLog:YES];