@lark-apaas/devtool-kits 0.1.0-alpha.8 → 0.1.0-alpha.9
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 +13 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -29203,7 +29203,15 @@ function collectLogsHandler(logDir, fileName) {
|
|
|
29203
29203
|
return async (req, res) => {
|
|
29204
29204
|
try {
|
|
29205
29205
|
const logContent = req.body;
|
|
29206
|
-
|
|
29206
|
+
if (!logContent.message) {
|
|
29207
|
+
return res.status(400).json({
|
|
29208
|
+
message: "message is required"
|
|
29209
|
+
});
|
|
29210
|
+
}
|
|
29211
|
+
const logLine = JSON.stringify({
|
|
29212
|
+
...logContent,
|
|
29213
|
+
server_time: (/* @__PURE__ */ new Date()).toISOString()
|
|
29214
|
+
}) + "\n";
|
|
29207
29215
|
await fs8.promises.appendFile(filePath, logLine);
|
|
29208
29216
|
res.json({
|
|
29209
29217
|
success: true
|
|
@@ -29227,7 +29235,10 @@ function collectLogsBatchHandler(logDir, fileName) {
|
|
|
29227
29235
|
}
|
|
29228
29236
|
const logLines = [];
|
|
29229
29237
|
for (const logContent of logContents) {
|
|
29230
|
-
logLines.push(JSON.stringify(
|
|
29238
|
+
logLines.push(JSON.stringify({
|
|
29239
|
+
...logContent,
|
|
29240
|
+
server_time: (/* @__PURE__ */ new Date()).toISOString()
|
|
29241
|
+
}) + "\n");
|
|
29231
29242
|
}
|
|
29232
29243
|
await fs8.promises.appendFile(filePath, logLines.join(""));
|
|
29233
29244
|
res.json({
|