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];