corexxx 1.0.23 → 1.0.24
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/dlog.js +18 -14
- package/dist/dlog.js.map +1 -1
- package/package.json +1 -1
- package/src/dlog.ts +17 -15
package/dist/dlog.js
CHANGED
|
@@ -7,42 +7,46 @@ exports.dlog = void 0;
|
|
|
7
7
|
var dlog;
|
|
8
8
|
(function (dlog) {
|
|
9
9
|
function d(msg, msg2 = null) {
|
|
10
|
-
console.log(`[DEBUG] ${msg} ${msg2 ? msg2 : ""} `);
|
|
10
|
+
console.log(`[${new Date().toLocaleString()}][DEBUG] ${msg} ${msg2 ? msg2 : ""} `);
|
|
11
11
|
}
|
|
12
12
|
dlog.d = d;
|
|
13
13
|
function e(msg, msg2 = null) {
|
|
14
|
-
console.log(`[ERROR] ${msg} ${msg2 ? msg2 : ""} `);
|
|
14
|
+
console.log(`[${new Date().toLocaleString()}][ERROR] ${msg} ${msg2 ? msg2 : ""} `);
|
|
15
15
|
}
|
|
16
16
|
dlog.e = e;
|
|
17
17
|
function i(msg, msg2 = null) {
|
|
18
|
-
console.log(`[INFO] ${msg} ${msg2 ? msg2 : ""} `);
|
|
18
|
+
console.log(`[${new Date().toLocaleString()}][INFO] ${msg} ${msg2 ? msg2 : ""} `);
|
|
19
19
|
}
|
|
20
20
|
dlog.i = i;
|
|
21
21
|
function s(msg, msg2 = null) {
|
|
22
|
-
console.log(`[SUCCESS] ${msg} ${msg2 ? msg2 : ""} `);
|
|
22
|
+
console.log(`[${new Date().toLocaleString()}][SUCCESS] ${msg} ${msg2 ? msg2 : ""} `);
|
|
23
23
|
}
|
|
24
24
|
dlog.s = s;
|
|
25
|
-
function ex(e, ignore =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
function ex(e, ignore = true) {
|
|
26
|
+
var _a;
|
|
27
|
+
try {
|
|
28
|
+
if (ignore) {
|
|
29
|
+
console.log(`[${new Date().toLocaleString()}][EXCEPTION] ${e.message}. Please check: ${(_a = e.stack) === null || _a === void 0 ? void 0 : _a.split("\n").slice(0, 2).join("")})`);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
console.log(`[${new Date().toLocaleString()}][EXCEPTION] Unwanted Exception: `, e.message, e.stack);
|
|
33
|
+
console.log(e);
|
|
29
34
|
}
|
|
30
|
-
|
|
31
|
-
console.log(e);
|
|
35
|
+
catch (e) { }
|
|
32
36
|
}
|
|
33
37
|
dlog.ex = ex;
|
|
34
38
|
function obj(obj, msg = "DEBUG OBJECT") {
|
|
35
|
-
console.log(
|
|
39
|
+
console.log(`[${new Date().toLocaleString()}][DEBUG] =========================== ${msg} START ======================`);
|
|
36
40
|
console.log(JSON.stringify(obj || {}, null, 1));
|
|
37
|
-
console.log(
|
|
41
|
+
console.log(`[${new Date().toLocaleString()}][DEBUG] =========================== ${msg} END ======================`);
|
|
38
42
|
}
|
|
39
43
|
dlog.obj = obj;
|
|
40
44
|
function map(map) {
|
|
41
|
-
console.log("=========================== DEBUG OBJECT START ======================");
|
|
45
|
+
console.log("[${new Date().toLocaleString()}]=========================== DEBUG OBJECT START ======================");
|
|
42
46
|
for (let x in map.keys()) {
|
|
43
47
|
console.log(`${JSON.stringify(x)} ==> ${JSON.stringify(map.get(x))}`);
|
|
44
48
|
}
|
|
45
|
-
console.log("=========================== DEBUG OBJECT END ======================");
|
|
49
|
+
console.log("[${new Date().toLocaleString()}]=========================== DEBUG OBJECT END ======================");
|
|
46
50
|
}
|
|
47
51
|
dlog.map = map;
|
|
48
52
|
})(dlog = exports.dlog || (exports.dlog = {}));
|
package/dist/dlog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dlog.js","sourceRoot":"","sources":["../src/dlog.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AACxD,uCAAuC;AACvC,8CAA8C;AAC9C,IAAiB,IAAI,
|
|
1
|
+
{"version":3,"file":"dlog.js","sourceRoot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ACD,OAAO,CAAC,GAAG,CAAC,qGAAqG,CAAC,CAAC;IACrH,CAAC;IANe,QAAG,MAMlB,CAAA;AACH,CAAC,EAnCgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAmCpB"}
|
package/package.json
CHANGED
package/src/dlog.ts
CHANGED
|
@@ -3,35 +3,37 @@
|
|
|
3
3
|
//let _log = colorogs(true, true, __filename);
|
|
4
4
|
export namespace dlog {
|
|
5
5
|
export function d(msg: String, msg2: any = null) {
|
|
6
|
-
console.log(`[DEBUG] ${msg} ${msg2 ? msg2 : ""} `);
|
|
6
|
+
console.log(`[${new Date().toLocaleString()}][DEBUG] ${msg} ${msg2 ? msg2 : ""} `);
|
|
7
7
|
}
|
|
8
8
|
export function e(msg: String, msg2: any = null) {
|
|
9
|
-
console.log(`[ERROR] ${msg} ${msg2 ? msg2 : ""} `);
|
|
9
|
+
console.log(`[${new Date().toLocaleString()}][ERROR] ${msg} ${msg2 ? msg2 : ""} `);
|
|
10
10
|
}
|
|
11
11
|
export function i(msg: String, msg2: any = null) {
|
|
12
|
-
console.log(`[INFO] ${msg} ${msg2 ? msg2 : ""} `);
|
|
12
|
+
console.log(`[${new Date().toLocaleString()}][INFO] ${msg} ${msg2 ? msg2 : ""} `);
|
|
13
13
|
}
|
|
14
14
|
export function s(msg: String, msg2: any = null) {
|
|
15
|
-
console.log(`[SUCCESS] ${msg} ${msg2 ? msg2 : ""} `);
|
|
15
|
+
console.log(`[${new Date().toLocaleString()}][SUCCESS] ${msg} ${msg2 ? msg2 : ""} `);
|
|
16
16
|
}
|
|
17
|
-
export function ex(e: Error, ignore =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
export function ex(e: Error, ignore = true) {
|
|
18
|
+
try {
|
|
19
|
+
if (ignore) {
|
|
20
|
+
console.log(`[${new Date().toLocaleString()}][EXCEPTION] ${e.message}. Please check: ${e.stack?.split("\n").slice(0, 2).join("")})`);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
console.log(`[${new Date().toLocaleString()}][EXCEPTION] Unwanted Exception: `, e.message, e.stack);
|
|
24
|
+
console.log(e);
|
|
25
|
+
} catch (e) {}
|
|
24
26
|
}
|
|
25
27
|
export function obj(obj?: Object, msg: string = "DEBUG OBJECT") {
|
|
26
|
-
console.log(
|
|
28
|
+
console.log(`[${new Date().toLocaleString()}][DEBUG] =========================== ${msg} START ======================`);
|
|
27
29
|
console.log(JSON.stringify(obj || {}, null, 1));
|
|
28
|
-
console.log(
|
|
30
|
+
console.log(`[${new Date().toLocaleString()}][DEBUG] =========================== ${msg} END ======================`);
|
|
29
31
|
}
|
|
30
32
|
export function map(map: Map<string, any>) {
|
|
31
|
-
console.log("=========================== DEBUG OBJECT START ======================");
|
|
33
|
+
console.log("[${new Date().toLocaleString()}]=========================== DEBUG OBJECT START ======================");
|
|
32
34
|
for (let x in map.keys()) {
|
|
33
35
|
console.log(`${JSON.stringify(x)} ==> ${JSON.stringify(map.get(x))}`);
|
|
34
36
|
}
|
|
35
|
-
console.log("=========================== DEBUG OBJECT END ======================");
|
|
37
|
+
console.log("[${new Date().toLocaleString()}]=========================== DEBUG OBJECT END ======================");
|
|
36
38
|
}
|
|
37
39
|
}
|