1.0.3 • Published 2 years ago

record-error v1.0.3

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

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>
  );
};
1.0.2

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago