QNReportConfig.m 881 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 "QNUtils.h"
  10. @implementation QNReportConfig
  11. + (instancetype)sharedInstance {
  12. static QNReportConfig *sharedInstance = nil;
  13. static dispatch_once_t onceToken;
  14. dispatch_once(&onceToken, ^{
  15. sharedInstance = [[self alloc] init];
  16. });
  17. return sharedInstance;
  18. }
  19. - (instancetype)init {
  20. self = [super init];
  21. if (self) {
  22. _reportEnable = YES;
  23. _interval = 10;
  24. _serverURL = @"https://uplog.qbox.me/log/4?compressed=gzip";
  25. _recordDirectory = [NSString stringWithFormat:@"%@/report", [QNUtils sdkCacheDirectory]];
  26. _maxRecordFileSize = 2 * 1024 * 1024;
  27. _uploadThreshold = 4 * 1024;
  28. _timeoutInterval = 10;
  29. }
  30. return self;
  31. }
  32. @end