Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #17912
| Path | csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Arno Welzel <usenet@arnowelzel.de> |
| Newsgroups | comp.lang.php |
| Subject | Re: How do you handle debug code? Removing from production versus conditional execution |
| Date | Fri, 3 May 2019 13:59:41 +0200 |
| Lines | 27 |
| Message-ID | <gj2opeFf3o6U1@mid.individual.net> (permalink) |
| References | <a2740b73-91c2-4002-9573-d0204fe2bec7@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 7bit |
| X-Trace | individual.net cQjHNt1VpgCK6aPTjJC0AwxucUiZt7d0FhLmFj024kLaj/GOIZ |
| Cancel-Lock | sha1:HQpmfmu73iqY+hUWatk/bP8UrR0= |
| In-Reply-To | <a2740b73-91c2-4002-9573-d0204fe2bec7@googlegroups.com> |
| Content-Language | en-US |
| Xref | csiph.com comp.lang.php:17912 |
Show key headers only | View raw
On 03.05.19 03:00, 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.
I don't add "debug code" at all. I use a Debugger like xdebug which is
supported in Visual Studio Code, PHPStorm etc.
--
Arno Welzel
https://arnowelzel.de
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How do you handle debug code? Removing from production versus conditional execution Ryan <rbilesky@gmail.com> - 2019-05-02 18:00 -0700
Re: How do you handle debug code? Removing from production versus conditional execution "J.O. Aho" <user@example.net> - 2019-05-03 06:52 +0200
Re: How do you handle debug code? Removing from production versus conditional execution bm <bm.tempo999@gémail.com> - 2019-05-09 01:31 +0000
Re: How do you handle debug code? Removing from production versus conditional execution Martin Gregorie <martin@mydomain.invalid> - 2019-05-03 08:18 +0000
Re: How do you handle debug code? Removing from production versus conditional execution Martin Gregorie <martin@mydomain.invalid> - 2019-05-03 08:22 +0000
Re: How do you handle debug code? Removing from production versus conditional execution Arno Welzel <usenet@arnowelzel.de> - 2019-05-03 13:59 +0200
Re: How do you handle debug code? Removing from production versus conditional execution Jerry Stuckle <jstucklex@attglobal.net> - 2019-05-03 09:38 -0400
Re: How do you handle debug code? Removing from production versus conditional execution bm <bm.tempo999@gémail.com> - 2019-05-09 01:33 +0000
Re: How do you handle debug code? Removing from production versus conditional execution Angle <angleaaaaaaa@zohomail.eu> - 2023-04-22 22:06 -0700
Re: How do you handle debug code? Removing from production versus conditional execution doctor@doctor.nl2k.ab.ca (The Doctor) - 2023-04-23 12:03 +0000
Re: How do you handle debug code? Removing from production versus conditional execution legalize+jeeves@mail.xmission.com (Richard) - 2023-04-24 17:50 +0000
Re: How do you handle debug code? Removing from production versus conditional execution Jerry Stuckle <stuckle.jerry@gmail.com> - 2023-04-24 14:27 -0400
csiph-web