@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 CHANGED
@@ -29215,7 +29215,15 @@ function collectLogsHandler(logDir, fileName) {
29215
29215
  return async (req, res) => {
29216
29216
  try {
29217
29217
  const logContent = req.body;
29218
- const logLine = JSON.stringify(logContent) + "\n";
29218
+ if (!logContent.message) {
29219
+ return res.status(400).json({
29220
+ message: "message is required"
29221
+ });
29222
+ }
29223
+ const logLine = JSON.stringify({
29224
+ ...logContent,
29225
+ server_time: (/* @__PURE__ */ new Date()).toISOString()
29226
+ }) + "\n";
29219
29227
  await import_fs.default.promises.appendFile(filePath, logLine);
29220
29228
  res.json({
29221
29229
  success: true
@@ -29239,7 +29247,10 @@ function collectLogsBatchHandler(logDir, fileName) {
29239
29247
  }
29240
29248
  const logLines = [];
29241
29249
  for (const logContent of logContents) {
29242
- logLines.push(JSON.stringify(logContent) + "\n");
29250
+ logLines.push(JSON.stringify({
29251
+ ...logContent,
29252
+ server_time: (/* @__PURE__ */ new Date()).toISOString()
29253
+ }) + "\n");
29243
29254
  }
29244
29255
  await import_fs.default.promises.appendFile(filePath, logLines.join(""));
29245
29256
  res.json({