Contribute  :  Support  :  Downloads  :  Forum  :  Links  :  Polls  :  Calendar  :  Directory  :  Advanced Search  
Geeklog The Ultimate Weblog System
Welcome to Geeklog
Thursday, May 15 2008 @ 11:39 PM EDT
   

Debugging ideas

GeeklogFor users that are modifying geeklog or integrating other components, the following are ideas to assist in debugging. It's hard to make assumptions on your skill level and not talk down or be too assumptive. You will need a basic understanding of syntax and of course know where you want to place the debug statements and what to display. Start basic and work your way up.

There are a few options but essentially, you are looking to add some output to tell you if the program is executing certain sections of code (am I here or here..) and the value of variables. I'll try to break it down as follows:

  1. You can use echo - this will appear at the top of your geeklog site output and may generate a HEADER related errro message. Examples:
    - echo "I am here ...";
    - echo "The value of uid is: " . $uid;
    - echo "The value of GEEKLOG_DIR is: " . $GEEKLOG_DIR;

  2. Use the COM_errorLOG function in lib-common.php, which writes to the /logs/error.log file. Examples:
    - COM_errorLOG("Inside the gallery init.php - geeklog code section");
    - COM_errorLOG("The value of CONF['theme'] is: " . $_CONF['theme'];
    - COM_errorLOG("Inside Lib-Common: USER[UID] is: ".$_USER['uid'] . ", Username is: ". $_USER['username'] . ", uid is: ". $uid);

  3. Use the var_dump() function to dump the value of a variable or array. Examples:
    - var_dump($_CONF);
    - var_dump($uid);
    - var_dump($HTTP_GET_VARS);

  4. Use my contributed debugBlock and function call to output to a block on your main page. Similar to using COM_errorLOG but you don't have to be tail'ing (watching) a logfile or require lib-common.php. Example:
    - phpblock_debugWrite(" User ID is: " . $_USER['uid']);


You can see how you concatenate variables and text in quotes using the "."
There are other options with integrated debugging environments but this is the how you would start, IMHO anyways.

Cheers,
Blaine

Story Options

Debugging ideas | 1 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Completely NEW-Need Help
Authored by: nanvr on Monday, September 02 2002 @ 03:18 PM EDT
I am completely new at uploading GL I know how to upload ftp files. I am operating on a MAC OS system...

Questions:
Can I upload GL on a MAC?
Do I download into an HTML editor?
If NO.. what is your advise.. I would like to get a \"yahoo\" look website going. Thank you Much...NVR