]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
add debug logging and do some from the remotesubscribe page
authorEvan Prodromou <evan@prodromou.name>
Fri, 30 May 2008 18:22:30 +0000 (14:22 -0400)
committerEvan Prodromou <evan@prodromou.name>
Fri, 30 May 2008 18:22:30 +0000 (14:22 -0400)
darcs-hash:20080530182230-84dde-b9b6f515affcd245abb5e199de02a8891138ff2a.gz

actions/remotesubscribe.php
lib/util.php

index 8f9dd3cb9ffc3528b6b2807f6bde0172c16afdec..e225fb683f284c9ec8a3d16b21b20d942afa0a12 100644 (file)
@@ -77,7 +77,9 @@ class RemotesubscribeAction extends Action {
                
                $fetcher = Auth_Yadis_Yadis::getHTTPFetcher();
                $yadis = Auth_Yadis_Yadis::discover($profile, $fetcher);
-               
+
+               common_debug('remotesubscribe.php: XRDS discovery result: "'.print_r($yadis, TRUE) .'"');
+                                        
                if (!$yadis || $yadis->fail) {
                        $this->show_form(_t('Not a valid profile URL (no YADIS document).'));
                        return;
index 12680112634e444a5aa18b80bbb5b49ec25dee75..d9171c743a4152ab9be8ace52635414d565a28c4 100644 (file)
@@ -553,3 +553,21 @@ function common_timestamp() {
 function _t($str) {
        return $str;
 }
+
+function common_ensure_syslog() {
+       static $initialized = false;
+       if (!$initialized) {
+               define_syslog_variables();
+               openlog("laconica", LOG_PID, LOG_USER);
+               $initialized = true;
+       }
+}
+
+function common_log($priority, $msg) {
+       common_ensure_syslog();
+       syslog($priority, $msg);
+}
+
+function common_debug($msg) {
+       common_log(LOG_DEBUG, $msg);
+}
\ No newline at end of file