send-sls-logger 0.0.31 → 0.0.33

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.
Files changed (2) hide show
  1. package/lib/init.js +4 -2
  2. package/package.json +1 -1
package/lib/init.js CHANGED
@@ -17,13 +17,15 @@ let maxLength = 200;
17
17
  const formatDataMaxLength = (data) => {
18
18
  if (getType(data) === "object") {
19
19
  return Object.keys(data).reduce((curr, key) => {
20
- curr[key] = formatDataMaxLength(data[key]);
20
+ curr[key] = /token/.test(key)
21
+ ? data[key]
22
+ : keyformatDataMaxLength(data[key]);
21
23
  return curr;
22
24
  }, {});
23
25
  } else if (getType(data) === "array") {
24
26
  return data.map((i) => formatDataMaxLength(i));
25
27
  } else if (getType(data) === "string" && data.length > maxLength) {
26
- return `${data.slice(0, maxLength)}...`;
28
+ return `${data.slice(0, maxLength)}...${data.length - maxLength}个字已忽略`;
27
29
  } else {
28
30
  return data;
29
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "send-sls-logger",
3
- "version": "0.0.31",
3
+ "version": "0.0.33",
4
4
  "description": "阿里云sls的logger发送",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"