ubiquity-os / ubiquity-os-logger

0 stars 6 forks source link

Add a non-formatted log option #45

Open Keyrxng opened 1 month ago

Keyrxng commented 1 month ago

In the cloudflare live worker logs the errors etc are not easy to read for obvious reasons.

We should add a new optional param to the log methods or a single one as part of initializing the class that disables/removes any kind of formatting and prints well in any env.

As you can imagine longer errors are very hard to immediately interpret.

image


We could probably make use of process.env which I'm sure works in cf workers as that usually contains hints as to what env we are in. If we can detect it's a terminal supporting env we should pretty print like normal but workers (and whatever other envs that happens in) we should try to improve it's readability.