From dc7ea49063a7321c5ebf7db53e1e58a94b0fe3f5 Mon Sep 17 00:00:00 2001 From: eagleychen Date: Thu, 9 May 2024 17:43:14 +0800 Subject: [PATCH] update logger --- Source/SDK/LinkVideo/TIoTCoreXP2PBridge.mm | 12 +++++++----- Source/SDK/LinkVideo/log/TIoTCoreLogger.h | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Source/SDK/LinkVideo/TIoTCoreXP2PBridge.mm b/Source/SDK/LinkVideo/TIoTCoreXP2PBridge.mm index 6a4b3443..104eaf3c 100644 --- a/Source/SDK/LinkVideo/TIoTCoreXP2PBridge.mm +++ b/Source/SDK/LinkVideo/TIoTCoreXP2PBridge.mm @@ -263,10 +263,12 @@ - (XP2PErrCode)startAppWith:(NSString *)pro_id dev_name:(NSString *)dev_name typ setUserCallbackToXp2p(XP2PDataMsgHandle, XP2PMsgHandle, XP2PReviceDeviceCustomMsgHandle); //启动logger - self.logger = [[TIoTCoreLogger alloc] init]; - self.logger.appuuid = nsstr_user_id; - self.logger.version = [TIoTCoreXP2PBridge getSDKVersion]; - [self.logger startLogging]; + if (self.logger == nil) { + self.logger = [[TIoTCoreLogger alloc] init]; + self.logger.appuuid = nsstr_user_id; + self.logger.version = [TIoTCoreXP2PBridge getSDKVersion]; + [self.logger startLogging]; + } //1.配置IOT_P2P SDK self.pro_id = pro_id; @@ -516,7 +518,7 @@ - (void)stopService:(NSString *)dev_name { stopService(dev_name.UTF8String); [self reportUserList:0 status:@"end"]; - [self.logger stopLogging]; +// [self.logger stopLogging]; //关闭文件 // [fileHandle closeFile]; // fileHandle = NULL; diff --git a/Source/SDK/LinkVideo/log/TIoTCoreLogger.h b/Source/SDK/LinkVideo/log/TIoTCoreLogger.h index 57ddf779..f264cf7b 100644 --- a/Source/SDK/LinkVideo/log/TIoTCoreLogger.h +++ b/Source/SDK/LinkVideo/log/TIoTCoreLogger.h @@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, strong)NSString *version; - (void)startLogging; -- (void)stopLogging; +//- (void)stopLogging; - (void)addLog:(NSString *)message; //- (void)reportLog;