Page 1 of 1

Selectively turning on debug mode.

Posted: Mon Nov 15, 2010 7:25 pm
by Wishbone
There are many times that I want to turn on debug mode, but don't want users to see the info when they go to my site. I just had this idea and made the following changes to my config.php file.

Replace:

Code: Select all

$config['debug'] = false;
with:

Code: Select all

if ($_GET['debug']) {
  $config['debug'] = true;
} else {
  $config['debug'] = false;
}
Now, when you go to your site, add '?debug=1' to the URL or '&debug=1' if you already have parameters.

You might not want to leave it this way, since it might give hackers extra information about your site if they stumble upon the debug option, but you can put it in whenever you need debug information, but don't want the site's users to see it.

Re: Selectively turning on debug mode.

Posted: Thu Dec 02, 2010 7:50 pm
by gully
This is nice.

Anyone know of an implementation of writing to file, instead of to screen?