I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
I did something similar a while ago when I was frustrated with certain frameworks (Drupal I'm taking about you).
Something that stopped me from making it "complete" was output buffering. If you want the log messages to appear as they're processed, and not get delayed or removed by subsequent crashing parts of your program, you ideally want to send it out of band, but you can't do that with PHP directly.
This results in the message hitting the browser immediately... or at least it does if there's only one level of output buffering! You can (un)fortunately nest them, so that's not a complete solution either.
The other solution I had was to run a second process receiving log messages. In Drupal, that's effectively what drush ws --tail does, but you could write a web interface instead so you didn't have to leave your browser.
Hi Akshay.
I did something similar a while ago when I was frustrated with certain frameworks (Drupal I'm taking about you).
Something that stopped me from making it "complete" was output buffering. If you want the log messages to appear as they're processed, and not get delayed or removed by subsequent crashing parts of your program, you ideally want to send it out of band, but you can't do that with PHP directly.
What you can do is hack the output buffer:
This results in the message hitting the browser immediately... or at least it does if there's only one level of output buffering! You can (un)fortunately nest them, so that's not a complete solution either.
The other solution I had was to run a second process receiving log messages. In Drupal, that's effectively what
drush ws --tail
does, but you could write a web interface instead so you didn't have to leave your browser.That is an interesting option, I will try to implement it, Thank you for the great suggestion.