Closed lcsqlpete closed 3 years ago
I have made a new feature for this.
// Begin debug logging
$database->beginDebug();
// All those functions will not be executed but will save it as a debug log.
$database->select()......
$database->update().....
....
var_dump($database->debugLog());
// Will out all debug logs as array
array(2) {
[0]=> string(10) "SELECT ... FROM"
[1]=> string(10) "UPDATE ... SET ... WHERE ..."
}
I think it would be useful to have the option to return the output of debug into a variable, e.g. $db->debug("return")->.... In my case, the script using Medoo was invoked via an Ajax call which expected JSON to be returned so I was not able to see the debug output. This feature would give users the ability to format the debug output appropriately for their needs.