1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 15:55:56 +00:00

improve JS error logging with additional stuff

This commit is contained in:
Andrew Dolgov
2017-03-05 10:50:15 +03:00
parent e0a957b3f6
commit 270c0a00e5
2 changed files with 19 additions and 13 deletions

View File

@@ -647,14 +647,19 @@ class RPC extends Handler_Protected {
}
function log() {
$logmsg = $this->dbh->escape_string($_REQUEST['logmsg']);
$msg = $this->dbh->escape_string($_REQUEST['msg']);
$file = $this->dbh->escape_string(basename($_REQUEST['file']));
$line = (int) $_REQUEST['line'];
$context = $this->dbh->escape_string($_REQUEST['context']);
if ($logmsg) {
if ($msg) {
Logger::get()->log_error(E_USER_WARNING,
$logmsg, '[client-js]', 0, false);
}
$msg, 'client-js:' . $file, $line, $context);
echo json_encode(array("message" => "HOST_ERROR_LOGGED"));
echo json_encode(array("message" => "HOST_ERROR_LOGGED"));
} else {
echo json_encode(array("error" => "MESSAGE_NOT_FOUND"));
}
}
}