Improve Logger calls

- Replace various deprecated Logger::log calls
- Reassign log level for verbose log calls
This commit is contained in:
Hypolite Petovan 2019-02-22 23:00:16 -05:00
parent 1917f04153
commit 8c1db51a76
9 changed files with 29 additions and 24 deletions

View file

@ -6,6 +6,7 @@ namespace Friendica\Util;
use Friendica\Core\Logger;
use DOMXPath;
use Friendica\Core\System;
use SimpleXMLElement;
/**
@ -422,10 +423,11 @@ class XML
$x = @simplexml_load_string($s);
if (!$x) {
Logger::log('libxml: parse: error: ' . $s, Logger::DATA);
Logger::error('Error(s) while parsing XML string.', ['callstack' => System::callstack()]);
foreach (libxml_get_errors() as $err) {
Logger::log('libxml: parse: ' . $err->code." at ".$err->line.":".$err->column." : ".$err->message, Logger::DATA);
Logger::info('libxml error', ['code' => $err->code, 'position' => $err->line . ":" . $err->column, 'message' => $err->message]);
}
Logger::debug('Erroring XML string', ['xml' => $s]);
libxml_clear_errors();
}
return $x;