+ print "";
+
+ print __("Severity:") . " ";
+ print_select_hash("severity", $severity,
+ [
+ E_USER_ERROR => __("Errors"),
+ E_USER_WARNING => __("Warnings"),
+ E_USER_NOTICE => __("Everything")
+ ], 'dojoType="fox.form.Select" onchange="Helpers.updateEventLog()"');
+
+ print "
"; # pull-right
+
+ print ""; # toolbar
+
+ print '';
+
+ print "
";
+
+ print "
".__("Error")." |
".__("Filename")." |
".__("Message")." |
@@ -53,7 +69,37 @@ class Pref_System extends Handler_Protected {
".__("Date")." |
";
- while ($line = $res->fetch()) {
+ $errno_values = [];
+
+ switch ($severity) {
+ case E_USER_ERROR:
+ $errno_values = [ E_ERROR, E_USER_ERROR, E_PARSE ];
+ break;
+ case E_USER_WARNING:
+ $errno_values = [ E_ERROR, E_USER_ERROR, E_PARSE, E_WARNING, E_USER_WARNING, E_DEPRECATED, E_USER_DEPRECATED ];
+ break;
+ }
+
+ if (count($errno_values) > 0) {
+ $errno_qmarks = arr_qmarks($errno_values);
+ $errno_filter_qpart = "errno IN ($errno_qmarks)";
+ } else {
+ $errno_filter_qpart = "true";
+ }
+
+ $sth = $this->pdo->prepare("SELECT
+ errno, errstr, filename, lineno, created_at, login, context
+ FROM
+ ttrss_error_log LEFT JOIN ttrss_users ON (owner_uid = ttrss_users.id)
+ WHERE
+ $errno_filter_qpart
+ ORDER BY
+ ttrss_error_log.id DESC
+ LIMIT 100");
+
+ $sth->execute($errno_values);
+
+ while ($line = $sth->fetch()) {
print "";
foreach ($line as $k => $v) {
@@ -73,15 +119,15 @@ class Pref_System extends Handler_Protected {
print "
";
} else {
-
print_notice("Please set LOG_DESTINATION to 'sql' in config.php to enable database logging.");
-
}
- print "
";
+ print ""; # content pane
+ print ""; # container
+ print ""; # accordion pane
- print "info ".__('PHP Information')."\">";
+ print "
";
ob_start();
phpinfo();
@@ -92,7 +138,7 @@ class Pref_System extends Handler_Protected {
print preg_replace( '%^.*(.*).*$%ms','$1', $info);
print "
";
- print "
";
+ print ""; # accordion pane
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB,
"hook_prefs_tab", "prefSystem");
diff --git a/js/PrefHelpers.js b/js/PrefHelpers.js
index 12710bc6a..0780fb708 100644
--- a/js/PrefHelpers.js
+++ b/js/PrefHelpers.js
@@ -51,7 +51,7 @@ const Helpers = {
return false;
},
updateEventLog: function() {
- xhrPost("backend.php", { op: "pref-system" }, (transport) => {
+ xhrPost("backend.php", { op: "pref-system", severity: dijit.byId("severity").attr('value') }, (transport) => {
dijit.byId('systemConfigTab').attr('content', transport.responseText);
Notify.close();
});