fancyyu-logger
v1.0.2
Published
SDK_POINT_LOGGER
Downloads
2
Readme
包含
传入选项options
requestUrl: string;
id?: string;
hashLogger: boolean;
jsErrorLogger: boolean;
historyLogger: boolean;
SDKVersion: string;
payload: Record<string, any>;
const logger = new PointsLogger({ hashLogger:true historyLogger: true, jsErrorLogger: true, requestUrl:xxxxx })
installDomLogger//->对某个DOM注册监听上报事件
logger.installDomLogger<T>(document.getElementsByClassName('test')[0], ['click'], { click: 'click-test' },payload:T);
jsErrorLogger: true //会自动进行错误上报因此,初始化的时候给requestUrl
historyLogger: true//自动监听history模式路由的页面的跳转
hashLogger:true //自动监听hash模式路由的页面的跳转
performanceLogger: {
//监听相关性能指标一下指标设为true的将会上报,此外提供installPerformanceLogger(cb)该方法接受一个回调,会将回调的结果进行上报,回调结果类型<T>(cb?: () => Record<keyof IDefaultOptions['performanceLogger'] & T, any>)
dnsTime: boolean
tcpTime: boolean
dnsLookupLogger: boolean
domAnalysis: boolean
whiteScreenTime: boolean
domReadyTime: boolean
}