@alicloud/alfa-core 1.5.9 → 1.5.10-beta.1
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/es/utils/logger.js +11 -3
- package/lib/utils/logger.js +11 -3
- package/package.json +1 -1
package/es/utils/logger.js
CHANGED
|
@@ -10,6 +10,11 @@ var logger = createLogger({
|
|
|
10
10
|
// project_xx 的外网域名,在 SLS project 概览里可以找到
|
|
11
11
|
logstore: 'loader' // 日志落库的地方
|
|
12
12
|
});
|
|
13
|
+
var loggerIdpt = createLogger({
|
|
14
|
+
project: 'alfa',
|
|
15
|
+
endpoint: 'log.cn-hangzhou-idpt-2.idptcloud01cs.com',
|
|
16
|
+
logstore: 'loader'
|
|
17
|
+
});
|
|
13
18
|
var Method = /*#__PURE__*/function (Method) {
|
|
14
19
|
Method["log"] = "log";
|
|
15
20
|
Method["info"] = "info";
|
|
@@ -75,8 +80,8 @@ var Logger = /*#__PURE__*/function () {
|
|
|
75
80
|
value: function track(method, topic, params) {
|
|
76
81
|
var data = this.mergeData(params);
|
|
77
82
|
|
|
78
|
-
//
|
|
79
|
-
if (!['aliyun.com', 'alibabacloud.com', 'aliyun-inc.com', 'alibaba-inc.com'].find(function (domain) {
|
|
83
|
+
// 国内站、国际站、idpt 允许上报
|
|
84
|
+
if (!['aliyun.com', 'alibabacloud.com', 'aliyun-inc.com', 'alibaba-inc.com', 'idptcloud01.com'].find(function (domain) {
|
|
80
85
|
return location.hostname.endsWith(domain);
|
|
81
86
|
})) return false;
|
|
82
87
|
|
|
@@ -85,7 +90,10 @@ var Logger = /*#__PURE__*/function () {
|
|
|
85
90
|
console[method](topic, data);
|
|
86
91
|
return;
|
|
87
92
|
}
|
|
88
|
-
|
|
93
|
+
var isIdpt = ['idptcloud01.com'].find(function (domain) {
|
|
94
|
+
return location.hostname.endsWith(domain);
|
|
95
|
+
});
|
|
96
|
+
(isIdpt ? loggerIdpt : logger)[method](topic, data);
|
|
89
97
|
}
|
|
90
98
|
}]);
|
|
91
99
|
}();
|
package/lib/utils/logger.js
CHANGED
|
@@ -17,6 +17,11 @@ var logger = (0, _consoleLoggerSls.default)({
|
|
|
17
17
|
// project_xx 的外网域名,在 SLS project 概览里可以找到
|
|
18
18
|
logstore: 'loader' // 日志落库的地方
|
|
19
19
|
});
|
|
20
|
+
var loggerIdpt = (0, _consoleLoggerSls.default)({
|
|
21
|
+
project: 'alfa',
|
|
22
|
+
endpoint: 'log.cn-hangzhou-idpt-2.idptcloud01cs.com',
|
|
23
|
+
logstore: 'loader'
|
|
24
|
+
});
|
|
20
25
|
var Method = /*#__PURE__*/function (Method) {
|
|
21
26
|
Method["log"] = "log";
|
|
22
27
|
Method["info"] = "info";
|
|
@@ -82,8 +87,8 @@ var Logger = exports.default = /*#__PURE__*/function () {
|
|
|
82
87
|
value: function track(method, topic, params) {
|
|
83
88
|
var data = this.mergeData(params);
|
|
84
89
|
|
|
85
|
-
//
|
|
86
|
-
if (!['aliyun.com', 'alibabacloud.com', 'aliyun-inc.com', 'alibaba-inc.com'].find(function (domain) {
|
|
90
|
+
// 国内站、国际站、idpt 允许上报
|
|
91
|
+
if (!['aliyun.com', 'alibabacloud.com', 'aliyun-inc.com', 'alibaba-inc.com', 'idptcloud01.com'].find(function (domain) {
|
|
87
92
|
return location.hostname.endsWith(domain);
|
|
88
93
|
})) return false;
|
|
89
94
|
|
|
@@ -92,7 +97,10 @@ var Logger = exports.default = /*#__PURE__*/function () {
|
|
|
92
97
|
console[method](topic, data);
|
|
93
98
|
return;
|
|
94
99
|
}
|
|
95
|
-
|
|
100
|
+
var isIdpt = ['idptcloud01.com'].find(function (domain) {
|
|
101
|
+
return location.hostname.endsWith(domain);
|
|
102
|
+
});
|
|
103
|
+
(isIdpt ? loggerIdpt : logger)[method](topic, data);
|
|
96
104
|
}
|
|
97
105
|
}]);
|
|
98
106
|
}();
|