]> git.wh0rd.org - tt-rss.git/commitdiff
implement old log entry purging in update_daemon_common; add some more error types...
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 16 Apr 2013 16:34:20 +0000 (20:34 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 16 Apr 2013 16:34:20 +0000 (20:34 +0400)
classes/logger.php
include/rssfuncs.php
prefs.css

index e0ca373634d784efd21a442f7e76ee7eeb96cd53..3c501eb92cd0fc2a5263e309e1daba0313383183 100644 (file)
@@ -4,7 +4,12 @@ class Logger {
        public static $errornames = array(
                1                       => 'E_ERROR',
                2                       => 'E_WARNING',
+               4                       => 'E_PARSE',
                8                       => 'E_NOTICE',
+               16                      => 'E_CORE_ERROR',
+               32                      => 'E_CORE_WARNING',
+               64                      => 'E_COMPILE_ERROR',
+               128             => 'E_COMPILE_WARNING',
                256             => 'E_USER_ERROR',
                512             => 'E_USER_WARNING',
                1024            => 'E_USER_NOTICE',
index b3bf25849d163aaff25d6adb599790caea87280a..0a20f5d8ea4438b7caf1f6ab4bf4ad46a0ad0060 100644 (file)
 
                expire_cached_files($debug);
                expire_lock_files($debug);
+               expire_error_log($link, $debug);
 
                $nf = 0;
 
                return $doc->saveXML($node);
        }
 
+       function expire_error_log($link, $debug) {
+               if ($debug) _debug("Removing old error log entries...");
+
+               if (DB_TYPE == "pgsql") {
+                       db_query($link, "DELETE FROM ttrss_error_log
+                               WHERE created_at < NOW() - INTERVAL '7 days'");
+               } else {
+                       db_query($link, "DELETE FROM ttrss_error_log
+                               WHERE created_at < DATE_SUB(NOW(), INTERVAL 7 DAY)");
+               }
+
+       }
+
        function expire_lock_files($debug) {
                if ($debug) _debug("Removing old lock files...");
 
index dc527ca1e7f5c01ef4bdee36cf0bfccf2c045a23..254de4f3408ec7c9b1114ed66978e1e054cf3dab 100644 (file)
--- a/prefs.css
+++ b/prefs.css
@@ -131,5 +131,11 @@ table.prefErrorLog tr.errrow td {
 
 table.prefErrorLog tr.errrow td.errno {
        font-style : italic;
+       font-weight : bold;
        white-space : nowrap;
 }
+
+table.prefErrorLog td.filename, table.prefErrorLog td.login, table.prefErrorLog td.timestamp {
+       color : gray;
+}
+