mirror of
https://github.com/friendica/friendica
synced 2025-04-26 05:50:11 +00:00
Log function
implement log() function.
This commit is contained in:
parent
d6d593d724
commit
14fde5dc9b
122 changed files with 1280 additions and 1161 deletions
|
@ -4,6 +4,7 @@
|
|||
*/
|
||||
namespace Friendica\Util;
|
||||
|
||||
use Friendica\Core\Logger;
|
||||
use DOMXPath;
|
||||
use SimpleXMLElement;
|
||||
|
||||
|
@ -248,7 +249,7 @@ class XML
|
|||
}
|
||||
|
||||
if (!function_exists('xml_parser_create')) {
|
||||
logger('Xml::toArray: parser function missing');
|
||||
Logger::log('Xml::toArray: parser function missing');
|
||||
return [];
|
||||
}
|
||||
|
||||
|
@ -263,7 +264,7 @@ class XML
|
|||
}
|
||||
|
||||
if (! $parser) {
|
||||
logger('Xml::toArray: xml_parser_create: no resource');
|
||||
Logger::log('Xml::toArray: xml_parser_create: no resource');
|
||||
return [];
|
||||
}
|
||||
|
||||
|
@ -275,9 +276,9 @@ class XML
|
|||
@xml_parser_free($parser);
|
||||
|
||||
if (! $xml_values) {
|
||||
logger('Xml::toArray: libxml: parse error: ' . $contents, LOGGER_DATA);
|
||||
Logger::log('Xml::toArray: libxml: parse error: ' . $contents, LOGGER_DATA);
|
||||
foreach (libxml_get_errors() as $err) {
|
||||
logger('libxml: parse: ' . $err->code . " at " . $err->line . ":" . $err->column . " : " . $err->message, LOGGER_DATA);
|
||||
Logger::log('libxml: parse: ' . $err->code . " at " . $err->line . ":" . $err->column . " : " . $err->message, LOGGER_DATA);
|
||||
}
|
||||
libxml_clear_errors();
|
||||
return;
|
||||
|
@ -423,9 +424,9 @@ class XML
|
|||
|
||||
$x = @simplexml_load_string($s);
|
||||
if (!$x) {
|
||||
logger('libxml: parse: error: ' . $s, LOGGER_DATA);
|
||||
Logger::log('libxml: parse: error: ' . $s, LOGGER_DATA);
|
||||
foreach (libxml_get_errors() as $err) {
|
||||
logger('libxml: parse: ' . $err->code." at ".$err->line.":".$err->column." : ".$err->message, LOGGER_DATA);
|
||||
Logger::log('libxml: parse: ' . $err->code." at ".$err->line.":".$err->column." : ".$err->message, LOGGER_DATA);
|
||||
}
|
||||
libxml_clear_errors();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue