Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

[Added] PHP nuDebug class: Add a flag

Information about updates, news, Code Library
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

[Added] PHP nuDebug class: Add a flag

Unread post by admin »

The new nuDebug class features a setFlag() function, allowing for the assignment of a flag or label to the debugging context.
This allows for more organized and informative debugging or logging output.

Code: Select all

nuDebug::setFlag('Critical Error')->log('Error: Failed to retrieve data..');
1. `nuDebug::setFlag('Critical Error')`: This part of the code calls the `setFlag()` function of the `nuDebug` class and passes a string `'Critical Error'` as an argument. This function sets a flag or label for the debugging context. It could be used to categorize or mark certain types of debug log entries for easier identification or filtering later on. In this case, it sets the flag to 'Critical Error'.

2. `->log('Failed...');`: After setting the flag, the `log()` function is called on the resulting object. This function logs a message along with the flag set previously. In this case, it logs the message `'Failed...'`.


nudebug_flag.png
nudebug_flag.png (29.02 KiB) Viewed 85 times

Available as of Files Version: V.4.5-2024.03.15.01
Post Reply