Re: How do you handle debug code? Removing from production versus conditional execution
Angle <[email protected]> Sat, 22 Apr 2023 22:06:52 -0700 (PDT)
| Newsgroups | comp.lang.php |
|---|---|
| Message-ID | <[email protected]> |
You know how stupid You look ? It is absolutely beyond belief !!!!!!!!!!!!!!!
On Friday, May 3, 2019 at 3:00:29 AM UTC+2, Ryan wrote:
> Perhaps an age old question, but how do you all deal with your debug code? Do you remove it before deploying to production, if so how do you make sure you remove it all without removing something important that will break your code? Or do you use conditional execution such as:
>
> if ($_ENV['DEGUG'] == true) {
> var_dump($data);
> }
>
> If so what condition are you using? An environment variable like above, a constant defined elsewhere in a config file?
>
> I think conditional execution would be easier but question if having to check if the debug code can run would slow down a production server, but the question is how much overhead really does it take to check $_ENV or a constant...
>
> So I am curious to see how others deal with this.