Add get_expected_content_length()
[privoxy.git] / tools / privoxy-log-parser.pl
index 766f6c6..e61eb93 100755 (executable)
@@ -8,7 +8,7 @@
 #
 # http://www.fabiankeil.de/sourcecode/privoxy-log-parser/
 #
-# $Id: privoxy-log-parser.pl,v 1.133 2012/07/27 17:37:00 fabiankeil Exp $
+# $Id: privoxy-log-parser.pl,v 1.135 2012/07/27 17:40:31 fabiankeil Exp $
 #
 # TODO:
 #       - LOG_LEVEL_CGI, LOG_LEVEL_ERROR, LOG_LEVEL_WRITE content highlighting
@@ -139,6 +139,7 @@ sub prepare_our_stuff () {
         Force           => 'red',
         Writing         => 'light_green',
         Received        => 'yellow',
+        Actions         => 'yellow',
         # ----------------------
         URL                  => 'yellow',
         path                 => 'brown',
@@ -1431,6 +1432,14 @@ sub handle_loglevel_connect ($) {
         return '' if SUPPRESS_ACCEPTED_CONNECTIONS;
         $c = highlight_matched_host($c, '(?<=connection from ).*');
 
+    } elsif ($c =~ m/^Closing client socket/) {
+
+        # Closing client socket 5. Keep-alive: 0, Socket alive: 1. Data available: 0.
+        $c = highlight_matched_pattern($c, 'Number', '(?<=socket )\d+');
+        $c = highlight_matched_pattern($c, 'Number', '(?<=Keep-alive: )\d+');
+        $c = highlight_matched_pattern($c, 'Number', '(?<=Socket alive: )\d+');
+        $c = highlight_matched_pattern($c, 'Number', '(?<=available: )\d+');
+
     } elsif ($c =~ m/^write header to: .* failed:/) {
 
         # write header to: 10.0.0.1 failed: Broken pipe
@@ -2225,6 +2234,7 @@ sub parse_loop () {
         'Fatal error'       => \&handle_loglevel_ignore,
         'Writing'           => \&handle_loglevel_ignore,
         'Received'          => \&handle_loglevel_ignore,
+        'Actions'           => \&handle_loglevel_ignore,
         'Unknown log level' => \&handle_loglevel_ignore,
     );
 
@@ -2316,6 +2326,7 @@ sub stats_loop () {
          'Fatal error'       => \&handle_loglevel_ignore,
          'Writing'           => \&handle_loglevel_ignore,
          'Received'          => \&handle_loglevel_ignore,
+         'Actions'           => \&handle_loglevel_ignore,
          'Unknown log level' => \&handle_loglevel_ignore
     );