]> git.mxchange.org Git - friendica.git/blobdiff - src/Network/CurlResult.php
"print_r" in logging replaced / obsolete stuff removed
[friendica.git] / src / Network / CurlResult.php
index e3cc9f98cd9f7faecd2ac9d8e9c335d2cc3beb02..9f52edfad698137ae06936b80f0e7f7354af2ddd 100644 (file)
@@ -1,3 +1,4 @@
+<?php
 /**
  * @copyright Copyright (C) 2020, Friendica
  *
  * You should have received a copy of the GNU Affero General Public License
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  *
- */ Friendica\Network;
+ */
+
+namespace Friendica\Network;
 
 use Friendica\Core\Logger;
+use Friendica\Core\System;
 use Friendica\Network\HTTPException\InternalServerErrorException;
 use Friendica\Util\Network;
 
@@ -127,7 +131,7 @@ class CurlResult
                $this->errorNumber = $errorNumber;
                $this->error = $error;
 
-               Logger::log($url . ': ' . $this->returnCode . " " . $result, Logger::DATA);
+               Logger::debug('construct', ['url' => $url, 'returncode' => $this->returnCode, 'result' => $result]);
 
                $this->parseBodyHeader($result);
                $this->checkSuccess();
@@ -163,8 +167,8 @@ class CurlResult
                }
 
                if (!$this->isSuccess) {
-                       Logger::log('error: ' . $this->url . ': ' . $this->returnCode . ' - ' . $this->error, Logger::INFO);
-                       Logger::log('debug: ' . print_r($this->info, true), Logger::DATA);
+                       Logger::notice('http error', ['url' => $this->url, 'code' => $this->returnCode, 'error'  => $this->error, 'callstack' => System::callstack(20)]);
+                       Logger::debug('debug', ['info' => $this->info]);
                }
 
                if (!$this->isSuccess && $this->errorNumber == CURLE_OPERATION_TIMEDOUT) {