bonus-material-app/nativeplugins/Mpaas-Scan/ios/APRemoteLogging.framework/Headers/APRemoteLogger+Internal.h

406 lines
12 KiB
C
Raw Normal View History

2024-12-20 09:23:59 +08:00
//
// APRemoteLogger+Internal.h
// APRemoteLogging
//
// Created by 卡迩 on 2017/4/12.
// Copyright © 2017年 Alipay. All rights reserved.
//
#import "APRemoteLogging.h"
@class APLogManualPageInfo;
/**
使 bizType bizType
*/
typedef NS_ENUM(NSInteger, mPaaSBizType)
{
mPaaS_Alive_iOS, // 报活
mPaaS_Launch_iOS, // 启动速度
mPaaS_LAG_iOS, // 卡顿
mPaaS_ANR_iOS, // 卡死
mPaaS_Crash_iOS, // 闪退
mPaaS_Automation_iOS, // 自动化
mPaaS_HotPatch_iOS, // hotpatch
mPaaS_Push_iOS, // 推送
mPaaS_Sync_iOS, // 同步
mPaaS_Scan_iOS, // 扫码
mPaaS_Nebula_iOS, // H5容器
mPaaS_TinyApp_iOS, // 小程序
mPaaS_RPC_iOS, // RPC
mPaaS_Upgrade_iOS, // 版本升级
mPaaS_ConfigService_iOS, // 开关配置
mPaaS_Share_iOS, // 分享
mPaaS_Storage_iOS, // 统一存储
mPaaS_LBS_iOS, // LBS
mPaaS_CDP_iOS, // CDP
mPaaS_Device_iOS, // 设备标识
mPaaS_TAC_iOS, // TAC
mPaaS_WebApp_iOS, // webapp
mPaaS_WebAppTiny_iOS, // webapp-tiny
mPaaS_NebulaTech_iOS, // NebulaTech
mPaaS_OCR_iOS, // OCR
mPaaS_SafeKeyboard_iOS, // 安全键盘
mPaaS_Traffic_iOS, // 流量监控
mPaaS_Framework_iOS, // 框架
mPaaS_Multimedia_iOS, //多媒体
mPaaS_Client_iOS, // 客户端 license
mPaaSMonitorNetiOS, // APM网络
};
//把APRemoteLogging.h中那堆不需要普通业务关注的接口移到了这里. by 卡迩
NS_ASSUME_NONNULL_BEGIN
@interface APRemoteLogger (Internal)
#pragma mark -
#pragma mark 兼容需要保留
#ifdef SDK_IS4_ALIPAY
/**
*
* 8.3使8.3使writeLogWithActionId:..
*
* @param dict log
*/
+(void)writeLogWithLogDictionary:(NSDictionary *) dict /*__deprecated*/;
#endif
#pragma mark -
#pragma mark Global State
/**
PV埋点(pageMonitor)pageInfo对象.
@return PV埋点生成的pageInfo对象.
*/
+ (nullable APLogManualPageInfo *)currentPageInfo;
/**
spm值.
@return spm值().
*/
+(nullable NSString *)lastClickSpm;
/**
spm值.
@note SDK调用,使.
@param spm spm值..
*/
+(void)setLastClickSpm:(nullable NSString *)spm;
#ifdef SDK_IS4_ALIPAY
/**
* ActionToken(TraceID)
*
* @return ActionToken(TraceID)
*/
+(nullable NSString *) currentActionToken;
/**
* ActionToken的生成时间戳RPC包大小而提供
*
* @return ActionToken的生成时间戳
*/
+(unsigned long long) tokenTimestamp;
/**
*
*
* @return
*/
+(nullable NSString *) currentActionControlID;
/**
* ID
*
* @return ID
*/
+(nullable NSString *) currentPageID;
+(nullable NSString *) lastPageID;
#endif
+(nullable NSString *) currentSubAppID;
#ifdef SDK_IS4_ALIPAY
+(void) resetCurrentPageId:(nonnull NSString *)pageId;
/**
*
*
* @return void
*/
+ (void)pageDidFinishInitializing;
/**
* str1|str2|str3格式字符串
*
* @param array
*
* @return
*/
+ (nonnull NSString *)convertToStringFromArray:(nonnull NSArray *)array;
/**
*
* key=value^key=value^key=value
*
* @return void
*/
+ (void)setFoundationExtended:(nullable NSDictionary *)dict;
/**
* key:value&key:value&key:value
*
* @param dictionary
* @param kvSeparator 使:key和value的连接字符key:value
* @param componentsSeparator 使&keyvalue组合后的连接字符key:value&key:value
* @return
*
*/
+ (nonnull NSString *)convertToStringFromDictionary:(nonnull NSDictionary *)dictionary
kvSeparator:(nullable NSString *)separator1
componentsSeparator:(nullable NSString *)separator2;
#endif
/**
* pageid
* @param index pageid索引
* @return
*/
+ (nullable NSString *)pageIdForIndex:(nonnull NSObject *)index;
#ifdef SDK_IS4_ALIPAY
/**
* pageid的时间戳
* @param index pageid索引
* @return
*/
+ (nullable NSString *)pageIdTimestampForIndex:(nonnull NSObject *)index;
/**
* spmid
* @param index pageid索引
* @return spmid
*/
+ (nullable NSString *)spmIdForIndex:(nonnull NSObject *)index;
#endif
/**
*
* @param index pageid索引
* @param type pageInfo类型
* @return
*/
+ (nullable NSString *)pageInfomationForIndex:(nonnull NSObject *)index forType:(APRemoteLoggerPageInfomationType)type;
#ifdef SDK_IS4_ALIPAY
/**
*
*/
+ (void)resetPageMonitorContext;
/**
* spmpage列表中添加page页
*/
+ (void)addSpmPage:(nonnull NSString *)spmPage;
/**
*
*/
+ (NSInteger)levelNumberForString:(nonnull NSString *)strLevel;
/**
*
*/
+ (void)setSwitchValue:(nullable NSString *)value forKey:(nonnull NSString *)key;
/**
@param configDict
*/
+(void)setSwitchDict:(NSDictionary *)configDict;
#endif
/**
*
*/
+ (NSString *)switchValueForKey:(nonnull NSString *)key;
#ifdef SDK_IS4_ALIPAY
/**
@note YES后,bizType的日志的上报会附加上历史日志,
@return ,, YES, NO.
*/
+ (BOOL)isHistoryLogFileChecked;
/**
refer值()
@return refer值()autotracker时nil.
*/
+ (nullable NSString *)currentAutoRefer;
#pragma mark -
#pragma mark 以下函数业务不要调用
+(void)mPaaS_writeCrashLog:(NSString *) report vcStack:(NSString *) vcStack;
+(NSDictionary*)stateWhenCrashed:(NSString*)vcStack thread:(thread_t)thread ucontext:(void *)ucontext;
+(void)mPaaS_writeCrashLog:(NSString *)report state:(NSDictionary*)state innerVersion:(NSString *)innerVersion;
+(void)writeOOMLog:(NSString *)report state:(NSDictionary *)infoDic;
+ (void)writePerformanceLogWithType:(APLogType)type
subType:(NSString *) subType
extraParams:(NSArray *) extraParams
actionControlID:(NSString *) controlID
actionToke:(NSString *) actionToken;
+(void)upload;
#endif
+ (void)protectExtentionParams:(NSMutableArray *)params;
#ifdef SDK_IS4_ALIPAY
+(void) logAutoEventWithBizType:(NSString*)bizType params:(NSArray*)params;
+(void) logPageBeginRenderWithPageName:(NSString *) name;
+(void) logPageStartWithPageId:(NSString *) pageId appId:(NSString *) appId
sourceAppId:(NSString *) sourceAppId pageName:(NSString *) pageName;
+ (void)logPageMonitorWithMonitorType:(NSString *)monitorType;
+ (NSString *)logPageMonitorType;
NSString *pageDidAppearName(NSString *pageName);
+ (void)logPageEndRenderWithPageName:(NSString *)name;
+(BOOL) statusForWriteLogSwitch:(NSString*) logType;
+(BOOL) statusForSendLogSwitch:(NSString*) logType;
+(void) checkCrashLogWithCompletionBlock:(void (^)(void)) block;
void updateSwitchProfile(NSString *actionType);
// 添加OC版本的接口为了利用OC的动态特性实现模块间解耦合
+ (void)SLWriteMonitorLog:(NSDictionary*)attachDict appID:(NSString*)appID monitorType:(NSString*)monitorType subMonitorType:(NSString*)subMonitorType mPaaSBizType:(mPaaSBizType)bizType;
+ (void)APWriteNetLog:(NSString*)identifier size:(NSString*)size type:(NSString*)type owner:(NSString*)owner extDict:(NSDictionary*)extDict;
void APWriteNetLog(NSString *identifier, NSString *size, NSString* type, NSString *owner, NSDictionary * extDict);
///**
// * 暂停日志上传最大暂停时间为60s时间过后自动打开日志上传
// * 设置这个机制的原因是防止调用方异常没有调用resumeLogUploading等情况下导致日志无法上传。
// *
// * @param secondes 自定义的日志暂停上传时间最大值为60s最小值为1s其余值将导致默认暂停10s
// */
//+(void) suspendLogUploadingForSeconds:(int) seconds;
///**
// * 立即恢复日志上传功能
// */
//+(void) resumeLogUploading;
#endif
/**
block. 30s执行一次.
*/
+(void)addPeriodicallyExecutedBlock:(void (^)(void))block;
#pragma mark - Interface for Alipayinside
/**
bizType
*/
+ (void)writeLogWithCustomContent:(NSString *) content
bizType:(NSString *) bizType;
#ifdef SDK_IS4_TAOBAO
/**
* id跟认证信息
* @param userId,id
*/
+ (void)setUserId:(NSString *)userId;
#endif
/**
@param module APMobileFramework
@param params key对应自定义分析配置中的属性
*/
- (void)writeMPaaSSDKLogWithModule:(NSString *)module params:(NSDictionary *)params;
#pragma mark - 仅 mPaaS 内部使用
+ (NSString *)getMPaaSBaseline;
/**
@param bizType 使
@param seed ID
@param extraParams @{"", "", "", @{}}
*/
+ (void)writeBehaviorLogWithBizType:(mPaaSBizType)bizType
seed:(nonnull NSString *)seed
extraParams:(nonnull NSArray *)extraParam;
/**
*/
+ (void)writeBehaviorLogWithActionId:(NSString *)actionId
extParams:(NSArray *)extraParam
appId:(NSString *)appId
seed:(NSString *)seed
ucId:(NSString *)ucId
bizType:(mPaaSBizType)bizType
formatterDictionary:(NSDictionary *)formatterDictionary;
/**
使
@param bizType 使
@param number 0
*/
+ (void)mPaaS_writePerformanceLogWithType:(mPaaSBizType)type
subType:(nullable NSString *)subType
extraParams:(nullable NSArray *)extraParams
formatterDictionary:(nullable NSDictionary *)formatterDictionary
perUploadNum:(NSUInteger)number;
/**
*/
+ (void)mPaaS_writeANRPerformanceLogWithBizType:(mPaaSBizType)bizType
subType:(nullable NSString *)subType
extraParams:(nullable NSArray *)extraParams
formatterDictionary:(nullable NSDictionary *)dictionary
perUploadNum:(NSUInteger)number;
/**
*/
void mPaaS_SLWriteMonitorLog(NSDictionary * attachDict, NSString* appID, NSString *monitorType, NSString *subMonitorType, mPaaSBizType bizType);
/**
*
*/
+ (NSString *)currentNetEnvString;
/**
APM网络RPC日志上报
*/
+ (void)mPaaSAPMRPCNetLog:(mPaaSBizType)bizType extDict:(NSDictionary*)extDict;
/**
APM
*/
+ (void)mPaaSAPMNetCustomLog:(NSDictionary*)extDict;
@end
NS_ASSUME_NONNULL_END