Open rockerBOO opened 11 months ago
I like that idea, and pretty easy to extend what I have with that.
=ERROR REPORT==== 10-Dec-2023::16:21:51.975168 ===
<<"Caught error in websocket handler: {errored,#{function => <<\"main\">>,line => 25,\n message => <<\"Assertion pattern match failed\">>,\n module => <<\"ws_test\">>,\n value => {error,nil},\n gleam_error => let_assert}}">>
Just pushed this, can do a release for this in the near future. Thank you!
Sweet! I have been using it in my current build and it helps quite a bit :). Though I think the formatting could be improved but not sure if you wanted to go in that direction of parsing the formatted string (at least inferring the new lines as new log lines or something)
For example, in gleam tests, I get this error format. I know, in error logging, it might not be ideal though.
When a handler crashes, this can be somewhat ideal at times. But ideally not regularly.
For example errors report as:
<<"Caught error in websocket handler">>
But maybe we can put the reason in the error string. This would help a lot in figuring out what is causing the error.
<<"Caught error in websocket handler: {errored,{case_clause,{ok,{rating_type,<<\"rating\">>}}}}">>
Would make it a lot easier to find these errors, even if it requires translating the erlang response. I would also love the ability to turn on stack traces but I did some poking around and couldn't find support in gleam for them.
Thank you for reading.
Edit:
Another example. Maybe it could be cleaned up a little more or handled differently.