Handle debug output ... not

01:33AM Apr 15, 2009 in category PHP by Alexander Pirsig

First of all remember you should NEVER EVERY PUT DEBUG OUTPUT ON LIVE SITES. In my time as php developer I came across a couple of NOT-Solutions. They are very funny but you should not use it (even in development) :)

The if($_SESSION['user']=="LAMMO") - method


intention: Your think it's not smart to use a logging facility.
implication:It's only a good solution if customers have the chance to review your code. To see how smart you are hidding everthing in a session. WOHOWW. It's also fun to have this extra performance sucking code snippets in your source code for presentation purpose to make sure they see the debug output!
implementation:

if($_SESSION['user'] == "LAMMO") echo $debug;
// * plz make sure not using any brackets! to get the best lammo result :)

I hide my content in the side something - tactic


intention: Your're smart ass and like to be cool so your place a font tag a round you debug output
implication: Google and Co. will index your site
implementation:

<\?php echo debug("asdf"); \?>

Use the Debug Pixel


Use the debug pixel

intention: don't get indexed by a search engine
implication: everyone can see you're debug output
implementation:




Okay okay the last one is just a prove of concept, we discused this while we've tried to find the best baddest solution to put debug output in a live environment

hope you had fun ;)

Kommentare[0] Tags: labs php coding antipattern log output logger debug