Improved logging

This commit is contained in:
Michael Vogel 2016-04-20 07:48:21 +02:00 committed by Roland Haeder
parent e088b919a8
commit 8fb9f3fee5
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78

View file

@ -1374,6 +1374,9 @@ function clean_contact_url($url) {
if (isset($parts["path"])) if (isset($parts["path"]))
$new_url .= $parts["path"]; $new_url .= $parts["path"];
if ($new_url != $url)
logger("Cleaned contact url ".$url." to ".$new_url." - Called by: ".App::callstack(), LOGGER_DEBUG);
return $new_url; return $new_url;
} }
@ -1386,7 +1389,7 @@ function fix_alternate_contact_address(&$contact) {
if (($contact["network"] == NETWORK_OSTATUS) AND poco_alternate_ostatus_url($contact["url"])) { if (($contact["network"] == NETWORK_OSTATUS) AND poco_alternate_ostatus_url($contact["url"])) {
$data = probe_url($contact["url"]); $data = probe_url($contact["url"]);
if ($contact["network"] == NETWORK_OSTATUS) { if ($contact["network"] == NETWORK_OSTATUS) {
logger("Fix primary url from ".$contact["url"]." to ".$data["url"], LOGGER_DEBUG); logger("Fix primary url from ".$contact["url"]." to ".$data["url"]." - Called by: ".App::callstack(), LOGGER_DEBUG);
$contact["url"] = $data["url"]; $contact["url"] = $data["url"];
$contact["addr"] = $data["addr"]; $contact["addr"] = $data["addr"];
$contact["alias"] = $data["alias"]; $contact["alias"] = $data["alias"];
@ -1405,8 +1408,10 @@ function get_gcontact_id($contact) {
$gcontact_id = 0; $gcontact_id = 0;
if (in_array($contact["network"], array(NETWORK_FEED, NETWORK_PHANTOM))) if (in_array($contact["network"], array(NETWORK_FEED, NETWORK_PHANTOM))) {
logger("Invalid network for contact url ".$contact["url"]." - Called by: ".App::callstack(), LOGGER_DEBUG);
return false; return false;
}
if ($contact["network"] == NETWORK_STATUSNET) if ($contact["network"] == NETWORK_STATUSNET)
$contact["network"] = NETWORK_OSTATUS; $contact["network"] = NETWORK_OSTATUS;
@ -1595,8 +1600,10 @@ function update_gcontact($contact) {
function update_gcontact_from_probe($url) { function update_gcontact_from_probe($url) {
$data = probe_url($url); $data = probe_url($url);
if (in_array($data["network"], array(NETWORK_FEED, NETWORK_PHANTOM))) if (in_array($data["network"], array(NETWORK_FEED, NETWORK_PHANTOM))) {
logger("Invalid network for contact url ".$data["url"]." - Called by: ".App::callstack(), LOGGER_DEBUG);
return; return;
}
update_gcontact($data); update_gcontact($data);
} }