Home > Article > Backend Development > PHPLog php program debugging and tracking tool_PHP tutorial
Principle:
1. During the execution of the program, record the variables you want to track, the call stack and the parameters of each function call in the corresponding places.
Record this information in a certain format. File, one variable per line, please refer to the code for the specific data format, I will not go into details here.
2. Now there is all the information (including call stack and parameters) every time the variable is recorded. When you log in through the browser When accessing this program, this program will read and analyze the entire file,
display all your debugging information on the page, and it will dynamically refresh ajax to keep synchronized with your debugging.
Draw a picture Well, it’s much clearer.
BackTrace is the call stack information, which is not reflected in the picture. It is dynamically refreshed by ajax.
Function:
Cut again Here are a few local diagrams:
1. Include files, debugging variables (the above is the program, the bottom is the debugging output of apache_request_headers())
2. Call stack list of a certain function in the drupal system
3. Call parameters of a function in the stack