QNReportConfig.m 989 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // QNReportConfig.m
  3. // QiniuSDK
  4. //
  5. // Created by 杨森 on 2020/7/14.
  6. // Copyright © 2020 Qiniu. All rights reserved.
  7. //
  8. #import "QNReportConfig.h"
  9. #import "QNConfig.h"
  10. #import "QNUtils.h"
  11. @implementation QNReportConfig
  12. + (instancetype)sharedInstance {
  13. static QNReportConfig *sharedInstance = nil;
  14. static dispatch_once_t onceToken;
  15. dispatch_once(&onceToken, ^{
  16. sharedInstance = [[self alloc] init];
  17. });
  18. return sharedInstance;
  19. }
  20. - (instancetype)init {
  21. self = [super init];
  22. if (self) {
  23. _reportEnable = YES;
  24. _interval = 0.5;
  25. _serverHost = kQNUpLogHost;
  26. _recordDirectory = [NSString stringWithFormat:@"%@/report", [QNUtils sdkCacheDirectory]];
  27. _maxRecordFileSize = 20 * 1024 * 1024;
  28. _uploadThreshold = 16 * 1024;
  29. _timeoutInterval = 10;
  30. }
  31. return self;
  32. }
  33. - (NSString *)serverURL {
  34. return [NSString stringWithFormat:@"https://%@/log/4?compressed=gzip", _serverHost];
  35. }
  36. @end