Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 1
    Apart from that fact that it's weird to leave logs via echo, you're probably looking for ob_end_clean(), which will just erase everything echo produced up until the command execution. That said, there're specific instruments for logging that should be used for this purpose
    – nicael
    Commented Jan 27, 2023 at 20:26
  • @nicael yes I'm aware, its just for the moment, not permanently. Its just for some quick testing, nothing else. I'll check out that function, might do for now. Thank you :) Commented Jan 27, 2023 at 20:31
  • stackoverflow.com/questions/6079492/how-to-print-a-debug-log is probably the real answer here. Don't work around this issue with ob_end_clean.
    – user229044
    Commented Jan 27, 2023 at 20:34
  • If you don't expect them to be shown in the browser, where do you expect them to go?
    – Barmar
    Commented Jan 27, 2023 at 20:34
  • @Barmar good point! I wasn't expecting them to be included along with the response, but clearly and obviously that would be the case. Commented Jan 27, 2023 at 20:41