/**
 * @file aliyun arms report method of commonJS
 * @since 1.0.7
 * @author whzcorcd <whzcorcd@gmail.com>
 *
 * 阿里前端监控
 * 配置文档 https://www.npmjs.com/package/alife-logger
 *
 * 使用示例：logger && logger.api(url, true, time, res.data.Flag, res.data.FlagString)
 * 示例解析：api(请求地址，请求成功与否，请求耗时，请求状态码，请求返回 Msg)
 */
const BrowerLogger = require('alife-logger');
// huh7k89btk@e7efa8f1e6c4d16
const __bl = pid => {
  try {
    return BrowerLogger.singleton({
      pid: pid,
      appType: 'web',
      imgUrl: 'https://arms-retcode.aliyuncs.com/r.png?',
      sendResource: true,
      enableLinkTrace: true,
      behavior: true,
      disableHook: false,
      useFmp: true,
      enableSPA: false
    });
  } catch (e) {
    // eslint-disable-next-line no-console
    console.error('init logger fail', e);
    return false;
  }
};
if (process.env.NODE_ENV === 'production') {
  __bl('huh7k89btk@e7efa8f1e6c4d16');
}
