]> iEval git - app-lastmsg.git/commitdiff
Write debug messages on STDERR
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 7 Jan 2017 18:50:29 +0000 (20:50 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 7 Jan 2017 18:50:29 +0000 (20:50 +0200)
lastmsg
lib/App/Lastmsg.pm

diff --git a/lastmsg b/lastmsg
index 65b47861db412574a42b116bf90a7e0c3011bff6..ee7e68a4bfa4b267b070d8d0c9f4945d9698ff5c 100755 (executable)
--- a/lastmsg
+++ b/lastmsg
@@ -103,8 +103,8 @@ F</usr/local/etc/>. See L<Config::Auto> for more information.
 =head1 ENVIRONMENT
 
 The only recognised environment variable is B<LASTMSG_DEBUG>, which if
-set to a true value causes the script to emit a lot of information
-about what it is doing.
+set to a true value causes the script to emit a lot of information on
+STDERR about what it is doing.
 
 =head1 TODO
 
index 8d2cce57eb09d247c336dcd61711c9ed32a58d0d..07f71db434c4789cceab6035c054527780f5f4ed 100644 (file)
@@ -59,14 +59,14 @@ sub run {
 
        for my $folder (@{$config->{inbox}}) {
                next unless -e $folder;
-               say "Scanning $folder (inbox)" if $ENV{LASTMSG_DEBUG};
+               say STDERR "Scanning $folder (inbox)" if $ENV{LASTMSG_DEBUG};
                my $folder = Email::Folder->new($folder);
                while (my $msg = $folder->next_message) {
                        my ($from) = grep { /^from$/i } $msg->header_names;
                        $from = $msg->header_raw($from);
                        if ($ENV{LASTMSG_DEBUG}) {
                                my $mid = grep { /^message-id$/i } $msg->header_names;
-                               say 'Processing ', $msg->header_raw('Message-ID'),
+                               say STDERR 'Processing ', $msg->header_raw('Message-ID'),
                                  " from $from" if $ENV{LASTMSG_DEBUG};
                        }
                        $process_message->($msg, $from);
@@ -75,7 +75,7 @@ sub run {
 
        for my $folder (@{$config->{sent}}) {
                next unless -e $folder;
-               say "Scanning $folder (sent)" if $ENV{LASTMSG_DEBUG};
+               say STDERR "Scanning $folder (sent)" if $ENV{LASTMSG_DEBUG};
                my $folder = Email::Folder->new($folder);
                while (my $msg = $folder->next_message) {
                        my @hdrs = grep { /^(?:to|cc|bcc)$/i } $msg->header_names;
@@ -85,7 +85,7 @@ sub run {
                        }
                        if ($ENV{LASTMSG_DEBUG}) {
                                my $mid = grep { /^message-id$/i } $msg->header_names;
-                               say 'Processing ', $msg->header_raw($mid),
+                               say STDERR 'Processing ', $msg->header_raw($mid),
                                  ' sent to ', join ',', @people if $ENV{LASTMSG_DEBUG};
                        }
                        $process_message->($msg, @people);
This page took 0.030553 seconds and 4 git commands to generate.