Improve debug messages

This commit is contained in:
Diogo Cordeiro 2018-08-01 01:58:31 +01:00
parent 69b252b244
commit d76ac3760b
2 changed files with 6 additions and 4 deletions

View File

@ -99,10 +99,12 @@ class ActivityPubPlugin extends Plugin
if ($candidate->getUrl() == $url) { // Sanity check if ($candidate->getUrl() == $url) { // Sanity check
return $candidate; return $candidate;
} else { } else {
throw new Exception("Notice not found."); common_debug ('ActivityPubPlugin Notice Grabber: '.$candidate->getUrl(). ' is different of '.$url);
throw new Exception('Notice not found.');
} }
} catch (Exception $e) { } catch (Exception $e) {
throw new Exception("Notice not found."); common_debug ('ActivityPubPlugin Notice Grabber failed to find: '.$url);
throw new Exception('Notice not found.');
} }
} }
} }

View File

@ -101,7 +101,7 @@ class Activitypub_explorer
$this->temp_res = $res; $this->temp_res = $res;
return true; return true;
} else { } else {
common_debug('ActivityPub Explorer: Invalid potential remote actor while ensuring URI: '.$url. '. He returned the following: '.json_encode($res, JSON_PRETTY_PRINT)); common_debug('ActivityPub Explorer: Invalid potential remote actor while ensuring URI: '.$url. '. He returned the following: '.json_encode($res, JSON_UNESCAPED_SLASHES));
} }
return false; return false;
@ -208,7 +208,7 @@ class Activitypub_explorer
$this->discovered_actor_profiles[]= $this->store_profile($res); $this->discovered_actor_profiles[]= $this->store_profile($res);
return true; return true;
} else { } else {
common_debug('ActivityPub Explorer: Invalid potential remote actor while grabbing remotely: '.$url. '. He returned the following: '.json_encode($res, JSON_PRETTY_PRINT)); common_debug('ActivityPub Explorer: Invalid potential remote actor while grabbing remotely: '.$url. '. He returned the following: '.json_encode($res, JSON_UNESCAPED_SLASHES));
} }
return false; return false;