Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #17912

Re: How do you handle debug code? Removing from production versus conditional execution

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 2019-05-03 13:59 +0200
Message-ID <gj2opeFf3o6U1@mid.individual.net> (permalink)
References <a2740b73-91c2-4002-9573-d0204fe2bec7@googlegroups.com>

Show all headers | 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 | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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