From c3626f2123b31a5a46282c1fce9b8526a3ad319c Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Fri, 4 May 2012 16:28:39 -0400 Subject: [PATCH] in log entries, print hook name first so log entries look like this: 86553 (connect) ident::geoip: US, United States 86553 (connect) ident::p0f: Windows 7 or 8 86553 (connect) check_earlytalker: remote host said nothing spontaneous, proceeding instead of this: 86553 ident::geoip: (connect): US, United States 86553 ident::p0f: (connect) Windows 7 or 8 86553 check_earlytalker: (connect): remote host said nothing spontaneous, proceeding Conflicts: plugins/logging/warn --- lib/Qpsmtpd.pm | 6 +++--- plugins/logging/warn | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Qpsmtpd.pm b/lib/Qpsmtpd.pm index e5196d1..86ac87d 100644 --- a/lib/Qpsmtpd.pm +++ b/lib/Qpsmtpd.pm @@ -132,9 +132,9 @@ sub varlog { return if $trace > $TraceLevel; # no logging plugins registered, fall back to STDERR - my $prefix = defined $plugin && defined $hook ? " $plugin plugin ($hook):" : - defined $plugin ? " $plugin plugin:" : - defined $hook ? " running plugin ($hook):" : ''; + my $prefix = defined $plugin && defined $hook ? " ($hook) $plugin:" : + defined $plugin ? " $plugin:" : + defined $hook ? " ($hook) running plugin:" : ''; warn join(' ', $$ . $prefix, @log), "\n"; } diff --git a/plugins/logging/warn b/plugins/logging/warn index d62997b..ce41b49 100644 --- a/plugins/logging/warn +++ b/plugins/logging/warn @@ -32,9 +32,9 @@ sub hook_logging { return DECLINED if $trace > $self->{_level}; - my $prefix = defined $plugin && defined $hook ? " $plugin plugin ($hook):" : - defined $plugin ? " $plugin plugin:" : - defined $hook ? " running plugin ($hook):" : ''), + my $prefix = defined $plugin && defined $hook ? " ($hook) $plugin:" : + defined $plugin ? " $plugin:" : + defined $hook ? " ($hook) running plugin:" : ''; warn join(' ', $$ . $prefix, @log), "\n";