[Coding / PHP] nuDebug() function
Posted: Fri May 16, 2025 2:27 am
The nuDebug() function is a PHP utility that helps developers debug their applications by logging information during code execution.
It accepts multiple types of inputs—such as strings, arrays, or objects—and writes them to a debug log that you can view in the "nuDebug Results" section of the application's menu.
Each entry in the debug log includes:
Example usage 2: Set a categroy
Example usage 3: Output multiple variables
To view the output, open nuDebug Results from the Options menu or press CTRL+SHIFT+D after running your code.
Video: Using nuBuilder's debugger - nuDebug()
For more information, see:
nuBuilder PHP Documentation
It accepts multiple types of inputs—such as strings, arrays, or objects—and writes them to a debug log that you can view in the "nuDebug Results" section of the application's menu.
Each entry in the debug log includes:
- A timestamp
- A description of the context (e.g., procedure name, event, or SQL error)
- Procedure – e.g., "Procedure ABC line 1"
- Event – e.g., "Before Edit of Form nuhome line 5"
- SQL Error – e.g., "SQL Error in nuRunQuery"
- Tracing execution flow
- Inspecting variable contents
- Debugging code
Code: Select all
$a = 'Bob';
nuDebug($a);
Code: Select all
nuDebug::setFlag('Test')->log('Error: Failed to retrieve data..');
Code: Select all
$s = 'Hello world';
$a = [1, 2, 3, 4];
$o = ['name' => 'Bob', 'phone' => '555 123456'];
nuDebug($s, $a, $o);
Video: Using nuBuilder's debugger - nuDebug()
For more information, see:
nuBuilder PHP Documentation