Skip to content
Extraits de code Groupes Projets
Valider ca21acd4 rédigé par cerdic's avatar cerdic
Parcourir les fichiers

Ameliorer les logs de recuperer_url() pour faciliter le debug

parent 5ba670f0
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -451,6 +451,7 @@ function recuperer_url($url, $options = []) { ...@@ -451,6 +451,7 @@ function recuperer_url($url, $options = []) {
$options['taille_max'] = $copy ? _COPIE_LOCALE_MAX_SIZE : _INC_DISTANT_MAX_SIZE; $options['taille_max'] = $copy ? _COPIE_LOCALE_MAX_SIZE : _INC_DISTANT_MAX_SIZE;
} }
spip_log("recuperer_url " . $options['methode']. " sur $url", 'distant' . _LOG_DEBUG);
// Ajout des en-têtes spécifiques si besoin // Ajout des en-têtes spécifiques si besoin
$formatted_data = ''; $formatted_data = '';
...@@ -557,7 +558,7 @@ function recuperer_url($url, $options = []) { ...@@ -557,7 +558,7 @@ function recuperer_url($url, $options = []) {
$options['datas'] = ''; $options['datas'] = '';
} }
} }
spip_log("recuperer_url recommence " . $options['methode']. " sur $url", 'distant'); spip_log("recuperer_url recommence " . $options['methode']. " sur $url", 'distant' . _LOG_DEBUG);
return recuperer_url($url, $options); return recuperer_url($url, $options);
} elseif ($res['status'] !== 200) { } elseif ($res['status'] !== 200) {
...@@ -577,6 +578,7 @@ function recuperer_url($url, $options = []) { ...@@ -577,6 +578,7 @@ function recuperer_url($url, $options = []) {
// on ne veut que les entetes // on ne veut que les entetes
if (!$options['taille_max'] or $options['methode'] == 'HEAD' or $result['status'] == '304') { if (!$options['taille_max'] or $options['methode'] == 'HEAD' or $result['status'] == '304') {
spip_log("RESULTAT recuperer_url " . $options['methode']. " sur $url : " . json_encode($result), 'distant' . _LOG_DEBUG);
return $result; return $result;
} }
...@@ -620,6 +622,10 @@ function recuperer_url($url, $options = []) { ...@@ -620,6 +622,10 @@ function recuperer_url($url, $options = []) {
$result['page'] = transcoder_page($result['page'], $result['headers']); $result['page'] = transcoder_page($result['page'], $result['headers']);
} }
$trace = json_decode(json_encode($result), true);
$trace['page'] = '...';
spip_log("RESULTAT recuperer_url " . $options['methode']. " sur $url : " . json_encode($trace), 'distant' . _LOG_DEBUG);
return $result; return $result;
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter