debugging using error_log stuff

From: Date: Sun, 12 Jun 2011 19:18:54 +0000
Subject: debugging using error_log stuff
Groups: php.general 
Request: Send a blank email to php-general+get-313493@lists.php.net to get a copy of this message
I read the recipe on debugging pmwiki functions and such at < http://www.pmwiki.org/wiki/Cookbook/DebuggingForCookbookAuthors > This isn't a PmWiki problem, per se, which is why it's going to both lists. I inserted the little sms function into pmwiki.php itself to try out (PmWiki developers: is there a better place to do this?) It's working, but I modified it slightly to log sms's: function sms($text,$switch=0){ global $MessagesFmt; error_log(date(DATE_RFC822)." Entered sms. text=$text. switch=$switch\n",3,"/var/log/pmwiki/error.log"); if ($switch == true || is_array($text)) { $MessagesFmt[] = "<pre>" . print_r($text,true) . "</pre>\n"; } else { $MessagesFmt[] = $text . "<br />\n"; } error_log(date(DATE_RFC822)." Exit sms.\n"); } So that i could watch it execute by tailing the error log. I put the following line at the very top of pmwiki.php: error_log(date(DATE_RFC822)." pmwiki start\n",3,"/var/log/pmwiki/error.log"); Then, down below, after where $MessagesFmt is zeroed out, I put: sms("Test Debugging"); However, all I see in the error log is the startup message, the entry message, BUT no exit message appears: Sun, 12 Jun 11 14:10:27 -0500 pmwiki start Sun, 12 Jun 11 14:10:27 -0500 Entered sms. text=Test Debugging. switch=0 The sms message shows up in the (:messages:) markup as expected. Any ideas what I'm doing wrong? This is stumping me.

« previous php.general (#313493) next »