Version 6 — Octobre 2021 — RealET
dans config/mes_options.php
, ajouter les lignes :
// Pour PHP :
error_reporting(E_ALL^E_NOTICE);
ini_set ("display_errors", "On");
// Pour SPIP et particulièrement SPIP3 :
define('_LOG_FILTRE_GRAVITE',8);
define('SPIP_ERREUR_REPORT', E_ALL^E_NOTICE);
define('SPIP_ERREUR_REPORT_INCLUDE_PLUGINS', E_ALL^E_NOTICE);
Le code suivant trace la pile PHP et peut être appelé en cas d’assertion non vérifiée ou en récupération d’erreur :
$log = "$message_assert\n".date('Y-m-d H:i:s');
$log .= ' (pid '.@getmypid().')'."\n";
ob_start();
debug_print_backtrace();
$log .= ob_get_contents();
ob_end_clean();
$log .= "\n\n";
ecrire_fichier(_DIR_TMP."debugtrace.log", $log, true, false);
Dans SPIP3 ya la fonction debug_print_backtrace();
.