88
99#import " QNDefine.h"
1010#import " QNUtils.h"
11+ #import " QNLogUtil.h"
1112#import " QNPartsUpload.h"
1213#import " QNZoneInfo.h"
1314#import " QNReportItem.h"
@@ -33,6 +34,7 @@ - (void)initData {
3334 [super initData ];
3435 // 根据文件从本地恢复上传信息,如果没有则重新构建上传信息
3536 if (self.config .resumeUploadVersion == QNResumeUploadVersionV1) {
37+ QNLogInfo (@" key:%@ 分片V1" , self.key );
3638 self.uploadPerformer = [[QNPartsUploadPerformerV1 alloc ] initWithFile: self .file
3739 fileName: self .fileName
3840 key: self .key
@@ -41,6 +43,7 @@ - (void)initData {
4143 configuration: self .config
4244 recorderKey: self .recorderKey];
4345 } else {
46+ QNLogInfo (@" key:%@ 分片V2" , self.key );
4447 self.uploadPerformer = [[QNPartsUploadPerformerV2 alloc ] initWithFile: self .file
4548 fileName: self .fileName
4649 key: self .key
@@ -75,10 +78,12 @@ - (int)prepareToUpload{
7578 if (self.uploadPerformer .currentRegion && self.uploadPerformer .currentRegion .isValid ) {
7679 // currentRegion有值,为断点续传,将region插入至regionList第一处
7780 [self insertRegionAtFirst: self .uploadPerformer.currentRegion];
81+ QNLogInfo (@" key:%@ 使用缓存region" , self.key );
7882 } else {
7983 // currentRegion无值 切换region
8084 [self .uploadPerformer switchRegion: [self getCurrentRegion ]];
8185 }
86+ QNLogInfo (@" key:%@ region:%@ " , self.key , self.uploadPerformer .currentRegion .zoneInfo .regionId );
8287
8388 if (self.file == nil ) {
8489 code = kQNLocalIOError ;
@@ -90,6 +95,7 @@ - (BOOL)switchRegion{
9095 BOOL isSuccess = [super switchRegion ];
9196 if (isSuccess) {
9297 [self .uploadPerformer switchRegion: self .getCurrentRegion];
98+ QNLogInfo (@" key:%@ 切换region:%@ " , self.key , self.uploadPerformer .currentRegion .zoneInfo .regionId );
9399 }
94100 return isSuccess;
95101}
@@ -106,8 +112,11 @@ - (void)startToUpload{
106112 self.uploadDataErrorResponseInfo = nil ;
107113 self.uploadDataErrorResponse = nil ;
108114
109- kQNWeakSelf ;
115+
116+ QNLogInfo (@" key:%@ serverInit" , self.key );
117+
110118 // 1. 启动upload
119+ kQNWeakSelf ;
111120 [self serverInit: ^(QNResponseInfo * _Nullable responseInfo, NSDictionary * _Nullable response) {
112121 kQNStrongSelf ;
113122
@@ -118,8 +127,10 @@ - (void)startToUpload{
118127 return ;
119128 }
120129
121- kQNWeakSelf ;
130+ QNLogInfo (@" key:%@ uploadRestData" , self.key );
131+
122132 // 2. 上传数据
133+ kQNWeakSelf ;
123134 [self uploadRestData: ^{
124135 kQNStrongSelf ;
125136
@@ -130,8 +141,10 @@ - (void)startToUpload{
130141 return ;
131142 }
132143
133- kQNWeakSelf ;
144+ QNLogInfo (@" key:%@ completeUpload" , self.key );
145+
134146 // 3. 组装文件
147+ kQNWeakSelf ;
135148 [self completeUpload: ^(QNResponseInfo * _Nullable responseInfo, NSDictionary * _Nullable response) {
136149 kQNStrongSelf ;
137150
@@ -152,7 +165,7 @@ - (void)startToUpload{
152165}
153166
154167- (void )uploadRestData : (dispatch_block_t )completeHandler {
155-
168+ QNLogInfo ( @" key: %@ 串行分片 " , self. key );
156169 [self performUploadRestData: completeHandler];
157170}
158171
0 commit comments