winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
4.76k stars 187 forks source link

No syntax highlighting when logging JSON objects #6580

Open eladb opened 1 month ago

eladb commented 1 month ago

I tried this:

new cloud.Function(inflight () => {
  let blob = { hello: 123, world: "hello" };
  log(blob);
});

This happened:

image

I expected this:

image

Is there a workaround?

No response

Anything else?

No response

Wing Version

No response

Node.js Version

No response

Platform(s)

No response

Community Notes

Chriscbr commented 1 month ago

Note: if you log a Json object in preflight and run wing compile, the text is colored on most terminals -- but this is mostly a side effect of how we're emitting console.log() in JavaScript preflight code. If you log something inflight and run wing test it's still uncolored:

Screenshot 2024-05-28 at 3 00 21 PM

It might be worthwhile to unify how logs are colored across all of these areas (preflight STDOUT, wing test STDOUT, and the Wing Console UI)