提交
This commit is contained in:
48
QXLive/Third/SDK/YTXMonitor.framework/Headers/ACMLogger.h
Normal file
48
QXLive/Third/SDK/YTXMonitor.framework/Headers/ACMLogger.h
Normal file
@@ -0,0 +1,48 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/// 日志级别
|
||||
extern NSString * const ACM_LOGGER_LEVEL_VERBOSE;
|
||||
extern NSString * const ACM_LOGGER_LEVEL_DEBUG;
|
||||
extern NSString * const ACM_LOGGER_LEVEL_INFO;
|
||||
extern NSString * const ACM_LOGGER_LEVEL_WARN;
|
||||
extern NSString * const ACM_LOGGER_LEVEL_ERROR;
|
||||
extern NSString * const ACM_LOGGER_LEVEL_REALTIME;
|
||||
|
||||
@interface ACMLogger : NSObject
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/// 日志是否入库,默认不入库
|
||||
@property (nonatomic, assign) BOOL enterDatabase;;
|
||||
|
||||
/// 日志是否允许上传,默认不上传
|
||||
@property (nonatomic, assign) BOOL isAllowUpload;
|
||||
|
||||
/**
|
||||
* 日志入库
|
||||
* @param obj 日志的具体内容
|
||||
* @param level 日志等级
|
||||
*/
|
||||
- (BOOL)logger:(id)obj level:(NSString *)level ;
|
||||
|
||||
/**
|
||||
* 上传日志
|
||||
* @param startDate 日志开始时间,如果传nil则查询不加该条件
|
||||
* @param endDate 日志结束时间,如果传nil则查询不加该条件
|
||||
* @param levels 日志等级数组,里面包含对应的日志等级字符串,如果传nil则查询不加该条件
|
||||
*/
|
||||
- (void)uploadLoggersWithLevels:(NSArray <NSString *>* _Nullable)levels
|
||||
startDate:(NSDate * _Nullable)startDate
|
||||
endDate:(NSDate * _Nullable)endDate;
|
||||
|
||||
/**
|
||||
* 上传失败的日志,一般放在重启应用后
|
||||
*/
|
||||
- (void)uploadFailedRecords;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
73
QXLive/Third/SDK/YTXMonitor.framework/Headers/ACMManager.h
Normal file
73
QXLive/Third/SDK/YTXMonitor.framework/Headers/ACMManager.h
Normal file
@@ -0,0 +1,73 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "ACMLogger.h"
|
||||
#import "ACMMonitor.h"
|
||||
#import "ACMProtocol.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ACMManager : NSObject
|
||||
|
||||
/// 日志操作对象
|
||||
@property (nonatomic, strong, readonly) ACMLogger *logger;
|
||||
|
||||
/// 埋点操作对象
|
||||
@property (nonatomic, strong, readonly) ACMMonitor *monitor;
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
* @param databaseName 数据库名,不指定则默认为 “ACMDatabase”
|
||||
* @param monitorTableName 埋点表名,必须要指定,用来区分不同产品数据
|
||||
* @param loggerTablename 日志表名,必须要指定,用来区分不同产品数据
|
||||
* @param limitKeyPrefix 限流信息存储到本地key的前缀,用来区分不同产品的限流缓存
|
||||
*/
|
||||
- (instancetype)initWithDatabaseName:(NSString * _Nullable)databaseName
|
||||
monitorTableName:(NSString *)monitorTableName
|
||||
loggerTableName:(NSString *)loggerTablename
|
||||
limitKeyPrefix:(NSString *)limitKeyPrefix;
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
* @param databaseName 数据库名,不指定则默认为 “ACMDatabase”
|
||||
* @param monitorTableName 埋点表名,必须要指定,用来区分不同产品数据
|
||||
* @param loggerTablename 日志表名,必须要指定,用来区分不同产品数据
|
||||
* @param limitKeyPrefix 限流信息存储到本地key的前缀,用来区分不同产品的限流缓存
|
||||
* @param uploadCount 每次上传条数
|
||||
* @param retryRightNow 上传失败是否立马重试,默认立马重试
|
||||
* @param uploadOnce 是否只执行一轮上传,默认NO
|
||||
*/
|
||||
- (instancetype)initWithDatabaseName:(NSString * _Nullable)databaseName
|
||||
monitorTableName:(NSString *)monitorTableName
|
||||
loggerTableName:(NSString *)loggerTablename
|
||||
limitKeyPrefix:(NSString *)limitKeyPrefix
|
||||
uploadCount:(NSInteger)uploadCount
|
||||
retryRightNow:(BOOL)retryRightNow
|
||||
uploadOnce:(BOOL)uploadOnce;
|
||||
|
||||
/**
|
||||
* 获取组件当前版本号
|
||||
*/
|
||||
- (NSString *)getVersion;
|
||||
|
||||
/**
|
||||
* 设置日志埋点上传代理对象
|
||||
* 注:这里是强引用
|
||||
* @param uploadDelegate 代理对象,需要实现 ACMProtocol 协议
|
||||
*/
|
||||
- (void)setUploadDelegate:(id<ACMProtocol> _Nullable)uploadDelegate;
|
||||
|
||||
/**
|
||||
* 更新限流相关
|
||||
* @param isLimit 是否限流
|
||||
* @param limitTimeHour 限流区间大小
|
||||
* @param limitCount 区间内限流次数
|
||||
*/
|
||||
- (void)updateLimitConfig:(BOOL)isLimit
|
||||
limitTimeHour:(NSInteger)limitTimeHour
|
||||
limitCount:(NSInteger)limitCount;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
55
QXLive/Third/SDK/YTXMonitor.framework/Headers/ACMMonitor.h
Normal file
55
QXLive/Third/SDK/YTXMonitor.framework/Headers/ACMMonitor.h
Normal file
@@ -0,0 +1,55 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NS_ENUM(NSInteger, ACM_DELETE_TYPE) {
|
||||
ACM_DELETE_TYPE_ALL,
|
||||
ACM_DELETE_TYPE_FAILED,
|
||||
ACM_DELETE_TYPE_UNUPLOAD
|
||||
};
|
||||
|
||||
|
||||
|
||||
@interface ACMMonitor : NSObject
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/// 埋点是否入库,默认入库
|
||||
@property (nonatomic, assign) BOOL enterDatabase;;
|
||||
|
||||
/// 埋点是否允许上传,默认上传
|
||||
@property (nonatomic, assign) BOOL isAllowUpload;
|
||||
|
||||
/**
|
||||
* 非实时埋点入库
|
||||
* @param obj 埋点具体内容
|
||||
*/
|
||||
- (BOOL)monitor:(id)obj;
|
||||
|
||||
/**
|
||||
* 实时埋点入库
|
||||
* @param obj 埋点的具体内容
|
||||
*/
|
||||
- (BOOL)monitorRealtime:(id)obj;
|
||||
|
||||
/**
|
||||
* 手动触发埋点上传,只上传未上传过的埋点
|
||||
*/
|
||||
- (void)uploadMonitorByManual;
|
||||
|
||||
/**
|
||||
* 上传失败的埋点,一般放在重启应用后
|
||||
*/
|
||||
- (void)uploadFailedRecords;
|
||||
|
||||
/**
|
||||
* 删除埋点
|
||||
* @param type 删除类型
|
||||
* @param block 结果的异步回调
|
||||
*/
|
||||
- (void)deleteRecordsByType:(ACM_DELETE_TYPE)type block:(void (^)(BOOL))block;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
17
QXLive/Third/SDK/YTXMonitor.framework/Headers/ACMProtocol.h
Normal file
17
QXLive/Third/SDK/YTXMonitor.framework/Headers/ACMProtocol.h
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol ACMProtocol <NSObject>
|
||||
|
||||
@required
|
||||
|
||||
/// 埋点抛出,可在抛出里面进行上传
|
||||
- (BOOL)uploadMonitors:(NSArray<NSDictionary *> *)monitors;
|
||||
/// 日志抛出,可在抛出里面进行上传
|
||||
- (BOOL)uploadLoggers:(NSArray<NSDictionary *> *)loggers;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
#import "ACMManager.h"
|
||||
#import "ACMProtocol.h"
|
||||
BIN
QXLive/Third/SDK/YTXMonitor.framework/Info.plist
Normal file
BIN
QXLive/Third/SDK/YTXMonitor.framework/Info.plist
Normal file
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
framework module YTXMonitor {
|
||||
umbrella header "YTXMonitor.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
34
QXLive/Third/SDK/YTXMonitor.framework/PrivacyInfo.xcprivacy
Normal file
34
QXLive/Third/SDK/YTXMonitor.framework/PrivacyInfo.xcprivacy
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSPrivacyCollectedDataTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>NSPrivacyCollectedDataType</key>
|
||||
<string>NSPrivacyCollectedDataTypeOtherDataTypes</string>
|
||||
<key>NSPrivacyCollectedDataTypeLinked</key>
|
||||
<false/>
|
||||
<key>NSPrivacyCollectedDataTypeTracking</key>
|
||||
<false/>
|
||||
<key>NSPrivacyCollectedDataTypePurposes</key>
|
||||
<array>
|
||||
<string>NSPrivacyCollectedDataTypePurposeAnalytics</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>NSPrivacyTracking</key>
|
||||
<false/>
|
||||
<key>NSPrivacyAccessedAPITypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPIType</key>
|
||||
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
|
||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||
<array>
|
||||
<string>CA92.1</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
BIN
QXLive/Third/SDK/YTXMonitor.framework/YTXMonitor
Normal file
BIN
QXLive/Third/SDK/YTXMonitor.framework/YTXMonitor
Normal file
Binary file not shown.
Reference in New Issue
Block a user