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 useconditional 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.
You know how stupid You look ? It is absolutely beyond belief !!!!!!!!!!!!!= >!!
On Friday, May 3, 2019 at 3:00:29=E2=80=AFAM 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 su= >re you remove it all without removing something important that will break y= >our code? Or do you use conditional execution such as:=20constant defined elsewhere in a config file?=20
=20
if ($_ENV['DEGUG'] =3D=3D true) {=20
var_dump($data);=20
}=20
=20
If so what condition are you using? An environment variable like above, a=
=20question is how much overhead really does it take to check $_ENV or a cons=
I think conditional execution would be easier but question if having to c= >heck if the debug code can run would slow down a production server, but the=
tant...=20
=20
So I am curious to see how others deal with this.
This abusive spamtroll came from
[Please do not mail me a copy of your followup]
doctor@doctor.nl2k.ab.ca (The Doctor) spake the secret code <u236qf$150$59@gallifrey.nk.ca> thusly:
This abusive spamtroll came from
You're only making it worse by responding to their posts. Either
report the abuse to their posting ISP or adjust your KILL file to drop
their posts so you don't see them.
To answer the real question from 2019 (whee!), instead of addding
"debug" code to your production deployment, write unit tests for
everything you do so that you have confidence in the deployed code.
An example can be found here:
<https://github.com/LegalizeAdulthood/manx>
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 351 |
Nodes: | 16 (2 / 14) |
Uptime: | 27:48:50 |
Calls: | 7,634 |
Files: | 12,796 |
Messages: | 5,688,674 |