]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/Email.php
Log function
[friendica.git] / src / Protocol / Email.php
index 00122e2eaeb3781b6463aaafb3c9b61815a3962f..5dba94ee5ab8b72ee6daf91d76201f523b5bb7ea 100644 (file)
@@ -4,6 +4,7 @@
  */
 namespace Friendica\Protocol;
 
+use Friendica\Core\Logger;
 use Friendica\Content\Text\HTML;
 use Friendica\Core\Protocol;
 
@@ -28,12 +29,12 @@ class Email
 
                $errors = imap_errors();
                if (!empty($errors)) {
-                       logger('IMAP Errors occured: ' . json_encode($errors));
+                       Logger::log('IMAP Errors occured: ' . json_encode($errors));
                }
 
                $alerts = imap_alerts();
                if (!empty($alerts)) {
-                       logger('IMAP Alerts occured: ' . json_encode($alerts));
+                       Logger::log('IMAP Alerts occured: ' . json_encode($alerts));
                }
 
                return $mbox;
@@ -54,21 +55,21 @@ class Email
                if (!$search1) {
                        $search1 = [];
                } else {
-                       logger("Found mails from ".$email_addr, LOGGER_DEBUG);
+                       Logger::log("Found mails from ".$email_addr, LOGGER_DEBUG);
                }
 
                $search2 = @imap_search($mbox, 'TO "' . $email_addr . '"', SE_UID);
                if (!$search2) {
                        $search2 = [];
                } else {
-                       logger("Found mails to ".$email_addr, LOGGER_DEBUG);
+                       Logger::log("Found mails to ".$email_addr, LOGGER_DEBUG);
                }
 
                $search3 = @imap_search($mbox, 'CC "' . $email_addr . '"', SE_UID);
                if (!$search3) {
                        $search3 = [];
                } else {
-                       logger("Found mails cc ".$email_addr, LOGGER_DEBUG);
+                       Logger::log("Found mails cc ".$email_addr, LOGGER_DEBUG);
                }
 
                $res = array_unique(array_merge($search1, $search2, $search3));
@@ -351,7 +352,7 @@ class Email
 
                //$message = '<html><body>' . $html . '</body></html>';
                //$message = html2plain($html);
-               logger('notifier: email delivery to ' . $addr);
+               Logger::log('notifier: email delivery to ' . $addr);
                mail($addr, $subject, $body, $headers);
        }