@zwa73/utils 1.0.30 → 1.0.31
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 +2 -1
- package/package.json +1 -1
- package/src/UtilCom.ts +2 -2
- package/test.js +1 -1
- package/testlog/log-2023-08-21.txt +65 -0
package/dist/UtilCom.js
CHANGED
|
@@ -5,6 +5,7 @@ const UtilInterfaces_1 = require("./UtilInterfaces");
|
|
|
5
5
|
const https = require("https");
|
|
6
6
|
const http = require("http");
|
|
7
7
|
const UtilLogger_1 = require("./UtilLogger");
|
|
8
|
+
const util_1 = require("util");
|
|
8
9
|
function sPost(type, json, options, timeLimit = -1) {
|
|
9
10
|
//转换为毫秒
|
|
10
11
|
const hasTimeLimit = (timeLimit >= 10);
|
|
@@ -33,7 +34,7 @@ function sPost(type, json, options, timeLimit = -1) {
|
|
|
33
34
|
throw funcName + " 接收反馈错误: resdata 为空";
|
|
34
35
|
try {
|
|
35
36
|
let obj = JSON.parse(resdata);
|
|
36
|
-
UtilLogger_1.SLogger.http(funcName + "
|
|
37
|
+
UtilLogger_1.SLogger.http(funcName + " 接受信息:", (0, util_1.inspect)((0, UtilInterfaces_1.stringifyJToken)(obj)));
|
|
37
38
|
resolve(obj);
|
|
38
39
|
return;
|
|
39
40
|
}
|
package/package.json
CHANGED
package/src/UtilCom.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { JObject, stringifyJToken } from "./UtilInterfaces";
|
|
|
2
2
|
import * as https from 'https';
|
|
3
3
|
import * as http from 'http';
|
|
4
4
|
import { SLogger } from "./UtilLogger";
|
|
5
|
-
|
|
5
|
+
import {inspect} from 'util';
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
function sPost(type:"http"|"https",json:JObject,options:Object,timeLimit:number=-1):Promise<JObject|null>{
|
|
@@ -38,7 +38,7 @@ function sPost(type:"http"|"https",json:JObject,options:Object,timeLimit:number=
|
|
|
38
38
|
throw funcName+" 接收反馈错误: resdata 为空";
|
|
39
39
|
try{
|
|
40
40
|
let obj = JSON.parse(resdata);
|
|
41
|
-
SLogger.http(funcName+"
|
|
41
|
+
SLogger.http(funcName+" 接受信息:",inspect(stringifyJToken(obj)));
|
|
42
42
|
resolve(obj);
|
|
43
43
|
return;
|
|
44
44
|
}
|
package/test.js
CHANGED
|
@@ -43,5 +43,5 @@ SLogger.debug('This is a debug message');
|
|
|
43
43
|
SLogger.silly('This is a silly message');
|
|
44
44
|
|
|
45
45
|
SLogger.fatal('This is an info message',123,true);
|
|
46
|
-
SLogger.info(
|
|
46
|
+
SLogger.info({a:"1111111111111111111111111111111111111111111111111111111111111111111111111111111\n11111"});
|
|
47
47
|
|
|
@@ -26,3 +26,68 @@
|
|
|
26
26
|
'11111',
|
|
27
27
|
'222222222222222222222222222222222222222222222222222222222222222222222222222222222222'
|
|
28
28
|
]
|
|
29
|
+
[13:31:26] [FATAL]: This is an fatal message
|
|
30
|
+
[13:31:26] [ERROR]: This is an error message
|
|
31
|
+
[13:31:26] [WARN]: This is a warning message
|
|
32
|
+
[13:31:26] [INFO]: This is an info message
|
|
33
|
+
[13:31:26] [HTTP]: This is an http message
|
|
34
|
+
[13:31:26] [VERBOSE]: This is a verbose message
|
|
35
|
+
[13:31:26] [DEBUG]: This is a debug message
|
|
36
|
+
[13:31:26] [SILLY]: This is a silly message
|
|
37
|
+
[13:31:26] [FATAL]: This is an info message
|
|
38
|
+
<number> 123
|
|
39
|
+
<boolean> true
|
|
40
|
+
[13:31:26] [INFO]: <object> [
|
|
41
|
+
'1111111111111111111111111111111111111111111111111111111111111111111111111111111
|
|
42
|
+
' +
|
|
43
|
+
'11111',
|
|
44
|
+
'222222222222222222222222222222222222222222222222222222222222222222222222222222222222'
|
|
45
|
+
]
|
|
46
|
+
[13:31:51] [FATAL]: This is an fatal message
|
|
47
|
+
[13:31:51] [ERROR]: This is an error message
|
|
48
|
+
[13:31:51] [WARN]: This is a warning message
|
|
49
|
+
[13:31:51] [INFO]: This is an info message
|
|
50
|
+
[13:31:51] [HTTP]: This is an http message
|
|
51
|
+
[13:31:51] [VERBOSE]: This is a verbose message
|
|
52
|
+
[13:31:51] [DEBUG]: This is a debug message
|
|
53
|
+
[13:31:51] [SILLY]: This is a silly message
|
|
54
|
+
[13:31:51] [FATAL]: This is an info message
|
|
55
|
+
<number> 123
|
|
56
|
+
<boolean> true
|
|
57
|
+
[13:31:51] [INFO]: <object> [
|
|
58
|
+
'1111111111111111111111111111111111111111111111111111111111111111111111111111111
|
|
59
|
+
' +
|
|
60
|
+
'11111',
|
|
61
|
+
'222222222222222222222222222222222222222222222222222222222222222222222222222222222222'
|
|
62
|
+
]
|
|
63
|
+
[13:32:55] [FATAL]: This is an fatal message
|
|
64
|
+
[13:32:55] [ERROR]: This is an error message
|
|
65
|
+
[13:32:55] [WARN]: This is a warning message
|
|
66
|
+
[13:32:55] [INFO]: This is an info message
|
|
67
|
+
[13:32:55] [HTTP]: This is an http message
|
|
68
|
+
[13:32:55] [VERBOSE]: This is a verbose message
|
|
69
|
+
[13:32:55] [DEBUG]: This is a debug message
|
|
70
|
+
[13:32:55] [SILLY]: This is a silly message
|
|
71
|
+
[13:32:55] [FATAL]: This is an info message
|
|
72
|
+
<number> 123
|
|
73
|
+
<boolean> true
|
|
74
|
+
[13:32:55] [INFO]: <object> [
|
|
75
|
+
'1111111111111111111111111111111111111111111111111111111111111111111111111111111\n' +
|
|
76
|
+
'11111',
|
|
77
|
+
'222222222222222222222222222222222222222222222222222222222222222222222222222222222222'
|
|
78
|
+
]
|
|
79
|
+
[13:33:25] [FATAL]: This is an fatal message
|
|
80
|
+
[13:33:25] [ERROR]: This is an error message
|
|
81
|
+
[13:33:25] [WARN]: This is a warning message
|
|
82
|
+
[13:33:25] [INFO]: This is an info message
|
|
83
|
+
[13:33:25] [HTTP]: This is an http message
|
|
84
|
+
[13:33:25] [VERBOSE]: This is a verbose message
|
|
85
|
+
[13:33:25] [DEBUG]: This is a debug message
|
|
86
|
+
[13:33:25] [SILLY]: This is a silly message
|
|
87
|
+
[13:33:25] [FATAL]: This is an info message
|
|
88
|
+
<number> 123
|
|
89
|
+
<boolean> true
|
|
90
|
+
[13:33:25] [INFO]: <object> {
|
|
91
|
+
a: '1111111111111111111111111111111111111111111111111111111111111111111111111111111\n' +
|
|
92
|
+
'11111'
|
|
93
|
+
}
|