@zwa73/utils 1.0.172 → 1.0.173

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/dist/UtilCom.js CHANGED
@@ -59,7 +59,7 @@ var UtilCom;
59
59
  }
60
60
  try {
61
61
  const obj = JSON.parse(resdata);
62
- UtilLogger_1.SLogger.http(`${funcName} 接受信息:`, UtilFunctions_1.UtilFunc.stringifyJToken(obj));
62
+ UtilLogger_1.SLogger.http(`${funcName} 接受信息:`, UtilFunctions_1.UtilFunc.stringifyJToken(obj, { compress: true, space: 2 }));
63
63
  resolve({
64
64
  headers: res.headers,
65
65
  statusCode: res.statusCode,
@@ -140,8 +140,8 @@ class SLogger {
140
140
  * @returns 自身
141
141
  */
142
142
  log(level, ...messages) {
143
- level = level || "silly";
144
- let strMessages = [];
143
+ level ??= "silly";
144
+ const strMessages = [];
145
145
  //上一条是字符串字符串
146
146
  let preIsString = true;
147
147
  for (let message of messages) {
@@ -161,7 +161,7 @@ class SLogger {
161
161
  }
162
162
  strMessages.push(out);
163
163
  }
164
- let outMessage = strMessages.join("\n");
164
+ const outMessage = strMessages.join("\n");
165
165
  this._logger.log(level, outMessage);
166
166
  return this;
167
167
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zwa73/utils",
3
- "version": "1.0.172",
3
+ "version": "1.0.173",
4
4
  "description": "my utils",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/UtilCom.ts CHANGED
@@ -92,7 +92,7 @@ function comReq(json:JObject,comReqOpt:ComRequestOption):Promise<HttpResp|undefi
92
92
  }
93
93
  try{
94
94
  const obj = JSON.parse(resdata) as JObject;
95
- SLogger.http(`${funcName} 接受信息:`,UtilFunc.stringifyJToken(obj));
95
+ SLogger.http(`${funcName} 接受信息:`,UtilFunc.stringifyJToken(obj,{compress:true,space:2}));
96
96
  resolve({
97
97
  headers: res.headers,
98
98
  statusCode: res.statusCode,
package/src/UtilLogger.ts CHANGED
@@ -137,8 +137,8 @@ export class SLogger{
137
137
  * @returns 自身
138
138
  */
139
139
  log(level:LogLevel,...messages:Array<any>):SLogger{
140
- level = level||"silly";
141
- let strMessages:Array<string> = [];
140
+ level ??= "silly";
141
+ const strMessages:Array<string> = [];
142
142
  //上一条是字符串字符串
143
143
  let preIsString = true;
144
144
  for(let message of messages){
@@ -156,7 +156,7 @@ export class SLogger{
156
156
  }
157
157
  strMessages.push(out);
158
158
  }
159
- let outMessage = strMessages.join("\n");
159
+ const outMessage = strMessages.join("\n");
160
160
  this._logger.log(level,outMessage);
161
161
  return this;
162
162
  }