« first day (5169 days earlier)    last day (1 day later) » 

00:45
@bwoebi This was the final version of the extension, before I gave up on it, jfyi: pastebin.com/PT5zeAPk
I gave up because I don't have stack trace for internal errors, only for E_USER_ errors... To capture these, I think I'd need to rollout something similar to Xdebug, which is much more involved than what I'm willing to do: github.com/xdebug/xdebug/blob/master/src/tracing/tracing.c
My initial goal was to have a more structured format for error logs, that's why I chose JSONL, which simplifies my parsing and categorization of error logs, and although not relevant but just for completeness: I also added a way to add "context" to the log, which in this case is the test name that is running in E2E
My main goal was this additional context - knowing at which context an error ocurred, and I think I can approach this in some other ways, such as resetting the error log between tests, etc, so I think I'll go this simpler route...
If someone wants to release an extension for JSONL error_logs, let me know :) - I think it would be an awesome addition to PHP.
Just out of curiosity, each line in my JSONL error log looks like this: jsonblob.com/1315843213906599936
01:02
@LucasBustamante the only issue with your code is that, if you call the original error handler before inserting the json, you'll have to wrap the code in zend_try.
Because otherwise it's going to skip over the execution of the rest of your function with the error codes which bail out, like E_ERROR.
@LucasBustamante In fact, I think on PHP 7 your code will properly handle E_ERROR?
It doesn't have traces for any E_* kind of notice/warning/error, etc, only for E_USER_*, with or without zend_try
I think for internal notices/warnings/errors I'd have to keep track of the stack myself, if I understood it correctly...?
Forgot to ping - @bwoebi
no you don't
capturing the trace should just work equally for E_* and E_USER_* errors.
Ah, I think I see... The problem might be in my userland test script, I might not have a stack to show for these types of errors, let me see..
That's a possibilty, not sure what code you're using.
01:56
@bwoebi Sorry for the delay, it's kinda late here. Thanks for your help!
I'll see if I pick it up again tomorrow
 
10 hours later…
12:02
o/

« first day (5169 days earlier)    last day (1 day later) »