@514labs/moose-lib 0.6.360 → 0.6.361

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.
@@ -29,7 +29,6 @@ __export(commons_exports, {
29
29
  mapTstoJs: () => mapTstoJs,
30
30
  rewriteImportExtensions: () => rewriteImportExtensions
31
31
  });
32
- import http from "http";
33
32
  import {
34
33
  existsSync,
35
34
  readdirSync,
@@ -204,16 +203,17 @@ var init_commons = __esm({
204
203
  });
205
204
  };
206
205
  cliLog = (log) => {
207
- const req = http.request({
208
- port: parseInt(process.env.MOOSE_MANAGEMENT_PORT ?? "5001"),
209
- method: "POST",
210
- path: "/logs"
211
- });
212
- req.on("error", (err) => {
213
- console.log(`Error ${err.name} sending CLI log.`, err.message);
214
- });
215
- req.write(JSON.stringify({ message_type: "Info", ...log }));
216
- req.end();
206
+ const level = log.message_type === "Error" ? "error" : log.message_type === "Warning" ? "warn" : "info";
207
+ const structuredLog = {
208
+ __moose_structured_log__: true,
209
+ level,
210
+ message: log.message,
211
+ resource_type: "runtime",
212
+ cli_action: log.action,
213
+ cli_message_type: log.message_type ?? "Info",
214
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
215
+ };
216
+ process.stderr.write(JSON.stringify(structuredLog) + "\n");
217
217
  };
218
218
  MAX_RETRIES = 150;
219
219
  MAX_RETRY_TIME_MS = 1e3;