From c6fb6c559a3b0445866e49917faf4d3515d0f6b8 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Wed, 20 Apr 2016 07:48:21 +0200 Subject: [PATCH] Improved logging --- include/socgraph.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/include/socgraph.php b/include/socgraph.php index d13dc1cd63..54ed62c0e5 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -1374,6 +1374,9 @@ function clean_contact_url($url) { if (isset($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; } @@ -1386,7 +1389,7 @@ function fix_alternate_contact_address(&$contact) { if (($contact["network"] == NETWORK_OSTATUS) AND poco_alternate_ostatus_url($contact["url"])) { $data = probe_url($contact["url"]); 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["addr"] = $data["addr"]; $contact["alias"] = $data["alias"]; @@ -1405,8 +1408,10 @@ function get_gcontact_id($contact) { $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; + } if ($contact["network"] == NETWORK_STATUSNET) $contact["network"] = NETWORK_OSTATUS; @@ -1595,8 +1600,10 @@ function update_gcontact($contact) { function update_gcontact_from_probe($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; + } update_gcontact($data); }