]> git.mxchange.org Git - friendica.git/commitdiff
Logging for feeds improved, new "process id" for logging
authorMichael Vogel <icarus@dabo.de>
Thu, 7 Jul 2016 18:32:13 +0000 (20:32 +0200)
committerMichael Vogel <icarus@dabo.de>
Thu, 7 Jul 2016 18:32:13 +0000 (20:32 +0200)
boot.php
include/bbcode.php
include/feed.php
include/text.php

index 4e8355d7d68ab4dce595da603c39f8fa9bde7de7..70ab308169c64618de879493b3b097b29994cbe1 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -517,6 +517,8 @@ class App {
         */
        public $template_engine_instance = array();
 
+       public $process_id;
+
        private $ldelim = array(
                'internal' => '',
                'smarty3' => '{{'
@@ -577,6 +579,8 @@ class App {
 
                $this->query_string = '';
 
+               $this->process_id = uniqid("log", true);
+
                startup();
 
                set_include_path(
index fd980a9b220387b645c858c1dd86fc4642f80e8b..c22813922bee6fcc8965802ed26e5bfb07e11ac1 100644 (file)
@@ -1140,6 +1140,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal
                $Text = preg_replace("/\[event\-finish\](.*?)\[\/event\-finish\]/ism",'',$Text);
                $Text = preg_replace("/\[event\-location\](.*?)\[\/event\-location\]/ism",'',$Text);
                $Text = preg_replace("/\[event\-adjust\](.*?)\[\/event\-adjust\]/ism",'',$Text);
+               $Text = preg_replace("/\[event\-id\](.*?)\[\/event\-id\]/ism",'',$Text);
        }
 
 
index 15e5f65366d939d7f351a5a3b4fe09e292b6a151..992d10e22747380ae44b75852e0d7813a61ae7da 100644 (file)
@@ -17,10 +17,15 @@ function feed_import($xml,$importer,&$contact, &$hub, $simulate = false) {
 
        $a = get_app();
 
-       logger("Import Atom/RSS feed", LOGGER_DEBUG);
+       if (!$simulate)
+               logger("Import Atom/RSS feed '".$contact["name"]."' (Contact ".$contact["id"].") for user ".$importer["uid"], LOGGER_DEBUG);
+       else
+               logger("Test Atom/RSS feed", LOGGER_DEBUG);
 
-       if ($xml == "")
+       if ($xml == "") {
+               logger('XML is empty.', LOGGER_DEBUG);
                return;
+       }
 
        $doc = new DOMDocument();
        @$doc->loadXML($xml);
@@ -150,8 +155,10 @@ function feed_import($xml,$importer,&$contact, &$hub, $simulate = false) {
                $header["last-child"] = 0;
        }
 
-       if (!is_object($entries))
+       if (!is_object($entries)) {
+               logger("There are no entries in this feed.", LOGGER_DEBUG);
                return;
+       }
 
        $items = array();
 
index 21111ba63181f3317a5cfdda78f4b8e7b7c5079f..2da9a180ea1ef30d0bd9fcac84dac396ffff78ed 100644 (file)
@@ -717,10 +717,15 @@ function logger($msg,$level = 0) {
        if((! $debugging) || (! $logfile) || ($level > $loglevel))
                return;
 
+       $process_id = session_id();
+
+       if ($process_id == "")
+               $process_id = get_app()->process_id;
+
        $callers = debug_backtrace();
        $logline =  sprintf("%s@%s\t[%s]:%s:%s:%s\t%s\n",
                                 datetime_convert(),
-                                session_id(),
+                                $process_id,
                                 $LOGGER_LEVELS[$level],
                                 basename($callers[0]['file']),
                                 $callers[0]['line'],