mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-06 08:37:30 +02:00
feat: improve logging and error handling (#2994)
* feat: improve logging and error handling * trim absolute path from file name * fix: suppress php errors from xml parsing * fix: respect the error reporting level in the custom error handler * feat: dont log error which is produced by bots * ignore error about invalid bridge name * upgrade bridge exception from warning to error * remove remnants of using phps builin error handler * move responsibility of printing php error from logger to error handler * feat: include url in log record context * fix: always include url in log record contect Also ignore more non-interesting exceptions. * more verbose httpexception * fix * fix
This commit is contained in:
@@ -25,18 +25,13 @@ class JsonFormat extends FormatAbstract
|
||||
|
||||
public function stringify()
|
||||
{
|
||||
$https = $_SERVER['HTTPS'] ?? null;
|
||||
$urlPrefix = $https === 'on' ? 'https://' : 'http://';
|
||||
$urlHost = $_SERVER['HTTP_HOST'] ?? '';
|
||||
$urlRequest = $_SERVER['REQUEST_URI'] ?? '';
|
||||
|
||||
$host = $_SERVER['HTTP_HOST'] ?? '';
|
||||
$extraInfos = $this->getExtraInfos();
|
||||
|
||||
$data = [
|
||||
'version' => 'https://jsonfeed.org/version/1',
|
||||
'title' => (!empty($extraInfos['name'])) ? $extraInfos['name'] : $urlHost,
|
||||
'home_page_url' => (!empty($extraInfos['uri'])) ? $extraInfos['uri'] : REPOSITORY,
|
||||
'feed_url' => $urlPrefix . $urlHost . $urlRequest
|
||||
'title' => empty($extraInfos['name']) ? $host : $extraInfos['name'],
|
||||
'home_page_url' => empty($extraInfos['uri']) ? REPOSITORY : $extraInfos['uri'],
|
||||
'feed_url' => get_current_url(),
|
||||
];
|
||||
|
||||
if (!empty($extraInfos['icon'])) {
|
||||
|
Reference in New Issue
Block a user