record-error
v1.0.3
Published
``` 私有库,不对外; ```
Downloads
5
Readme
Record Error
私有库,不对外;
使用方法
import RecordError from 'record-error';
const Demo = () => {
const recordError = useRef(
new RecordError({
siteIdKey: '4ebd531d399b7d1e54c7',
}),
);
const onPost = () => {
recordError.current.create([
{
title: '',
errorLevel: 1, //'1:严重,2:警告;3:提示;',
errorType: 'HTTP', //'HTTP: 网络错误; LOGICAL:逻辑错误;‘’: 不能定义的错误;',
language: 'go', //Go','JavaScript','')
// clientEnv : '', // '客户环境, 如 浏览器 UA',
content: 'error content...',
},
]);
};
useEffect(() => {
return () => {
recordError.current.destroy();
};
}, []);
return (
<div>
<Button onClick={onPost} type="primary">
点击上报
</Button>
</div>
);
};