@tusi-ai/logger 0.0.1-beta.1 → 0.0.1-beta.3
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/index.cjs +4 -1
- package/dist/index.js +4 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -37,7 +37,8 @@ var DEFAULT_ENV = "production";
|
|
|
37
37
|
|
|
38
38
|
// src/index.ts
|
|
39
39
|
function getAegisV2() {
|
|
40
|
-
|
|
40
|
+
if (typeof window === "undefined") return void 0;
|
|
41
|
+
const { aegisV2 } = window;
|
|
41
42
|
if (typeof (aegisV2 == null ? void 0 : aegisV2.error) === "function" && typeof (aegisV2 == null ? void 0 : aegisV2.info) === "function") {
|
|
42
43
|
return aegisV2;
|
|
43
44
|
}
|
|
@@ -96,6 +97,7 @@ var Logger = class {
|
|
|
96
97
|
* @param content - 日志正文。已配置 `contentPrefix` 时拼在前面
|
|
97
98
|
*/
|
|
98
99
|
info(content) {
|
|
100
|
+
console.log(content);
|
|
99
101
|
this.report("info", content);
|
|
100
102
|
}
|
|
101
103
|
/**
|
|
@@ -104,6 +106,7 @@ var Logger = class {
|
|
|
104
106
|
* @param content - 日志正文。已配置 `contentPrefix` 时拼在前面
|
|
105
107
|
*/
|
|
106
108
|
error(content) {
|
|
109
|
+
console.error(content);
|
|
107
110
|
this.report("error", content);
|
|
108
111
|
}
|
|
109
112
|
report(level, content) {
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,8 @@ var DEFAULT_ENV = "production";
|
|
|
31
31
|
|
|
32
32
|
// src/index.ts
|
|
33
33
|
function getAegisV2() {
|
|
34
|
-
|
|
34
|
+
if (typeof window === "undefined") return void 0;
|
|
35
|
+
const { aegisV2 } = window;
|
|
35
36
|
if (typeof (aegisV2 == null ? void 0 : aegisV2.error) === "function" && typeof (aegisV2 == null ? void 0 : aegisV2.info) === "function") {
|
|
36
37
|
return aegisV2;
|
|
37
38
|
}
|
|
@@ -90,6 +91,7 @@ var Logger = class {
|
|
|
90
91
|
* @param content - 日志正文。已配置 `contentPrefix` 时拼在前面
|
|
91
92
|
*/
|
|
92
93
|
info(content) {
|
|
94
|
+
console.log(content);
|
|
93
95
|
this.report("info", content);
|
|
94
96
|
}
|
|
95
97
|
/**
|
|
@@ -98,6 +100,7 @@ var Logger = class {
|
|
|
98
100
|
* @param content - 日志正文。已配置 `contentPrefix` 时拼在前面
|
|
99
101
|
*/
|
|
100
102
|
error(content) {
|
|
103
|
+
console.error(content);
|
|
101
104
|
this.report("error", content);
|
|
102
105
|
}
|
|
103
106
|
report(level, content) {
|