Phplog PHP program debugging and tracking tools _php skills

Source: Internet
Author: User
Tags drupal
Principle:

1. In the process of execution, record the variables you want to track and the call stacks and the parameters of each function call in the appropriate place.
The information is recorded in a certain format to the file, a variable row, the specific data format see the code, here is not detailed.

2. Now that you have all the information (including the call stack and parameters) every time you log a variable, the program reads the entire file into analysis when you access it through the browser.
Display all your debugging information on the page, and it will be dynamically Ajax refreshed and kept synchronized with your debugging.

Draw a picture, it's much clearer.



BackTrace is the call stack information, not reflected in the diagram, is the dynamic Ajax refresh.


Function:

A few more pictures of this machine are illustrated below:

1. include file, debug variable (above is program, below is apache_request_headers () debug output)



A list of call stacks for a function of a 2.drupal system



3. Call parameters of a function in the stack




Postscript:


Program basically implemented debugging, tracking the function of PHP variables, but also with the call stack and call parameters to view the function.

Now Echo,print_r,var_dump and other system functions, if not necessary, I have very little to debug output, basically with this will be able to get what you want.

Particularly complex systems such as Drupal can clearly understand how the program is executed.


Description

The program is written in PhP4, in php4.4.8, 5.2.5 on the test, the theory is to support PHP4, PHP5.

Linux, Windows, Ie6-7, Firefox has also been tested, but still do not dare to ensure that in your environment does not make mistakes, if so, please amend yourself.

Please do not allow the log file to exceed 5M size, the browser may crash.
Download Address http://www.jb51.net/codes/20851.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.