@zxhy-npm/send-sls-logger 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/init.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { deviceInfo, referUrl } from "./trace";
1
2
  const getType = (val) => {
2
3
  return Object.prototype.toString.call(val).toLocaleLowerCase().slice(8, -1);
3
4
  };
@@ -136,7 +137,13 @@ class DefaultLog {
136
137
  else {
137
138
  debug && console.log(`logger ${type}`, formatResultObj);
138
139
  }
139
- tracker.send(formatResultObj);
140
+ tracker.send({
141
+ pagePath: () => location.href,
142
+ pageName: () => document.title,
143
+ deviceInfo,
144
+ referUrl: () => referUrl.referUrl,
145
+ ...formatResultObj,
146
+ });
140
147
  }
141
148
  send(type) {
142
149
  const self = this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zxhy-npm/send-sls-logger",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "阿里云sls的logger发送",
5
5
  "scripts": {
6
6
  "build": "rm -rf lib && tsc"
package/readme.md CHANGED
@@ -52,3 +52,5 @@ miniLog.info({ msg: "这是一条默认日志" });
52
52
  更新内容: 会自动删除 预发送数据 中的 undefined 与 null
53
53
  1.1.4 ---------- 1/10/2025, 11:35:16 AM
54
54
  更新内容: trace 导出deviceInfo 以及 referUrl
55
+ 1.1.5 ---------- 1/10/2025, 11:40:55 AM
56
+ 更新内容: sls 打日志的时候,将deviceInfo、referUrl、pagePath, pageName直接带进去,不需要使用者增加