summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-08-06 14:07:17 +0200
committerFlorian Pritz <bluewind@xinu.at>2018-08-06 14:07:17 +0200
commitf7513a81e379e3ef4c6946c7e5536fef1616c21b (patch)
tree90e214592bde5a53884f66ae62a1556e279577c5
parent12322867dfc395b55e523dae5b87d20c657864c5 (diff)
downloadApp-ImapNotify-f7513a81e379e3ef4c6946c7e5536fef1616c21b.tar.gz
App-ImapNotify-f7513a81e379e3ef4c6946c7e5536fef1616c21b.tar.xz
Use Log4perl for timestamps in output
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--cpanfile1
-rwxr-xr-xscript/imap-notify.pl11
2 files changed, 10 insertions, 2 deletions
diff --git a/cpanfile b/cpanfile
index 05605b5..a1b17cc 100644
--- a/cpanfile
+++ b/cpanfile
@@ -5,6 +5,7 @@ requires 'Function::Parameters';
requires 'IO::Socket::SSL';
requires 'Log::Any';
requires 'Log::Any::Adapter';
+requires 'Log::Log4perl';
requires 'MCE::Hobo';
requires 'Path::Tiny';
requires 'Syntax::Keyword::Try';
diff --git a/script/imap-notify.pl b/script/imap-notify.pl
index 234c5e8..5fefaf6 100755
--- a/script/imap-notify.pl
+++ b/script/imap-notify.pl
@@ -7,7 +7,8 @@ use strict;
use App::ImapNotify;
use Function::Parameters;
-use Log::Any::Adapter ('Stderr', log_level => "info");
+use Log::Any::Adapter;
+use Log::Log4perl qw(:easy);
use MCE::Hobo;
use Path::Tiny;
use TOML qw(from_toml);
@@ -89,9 +90,15 @@ L<App::ImapNotify>
my $config = from_toml(path(($ENV{XDG_CONFIG_HOME} // $ENV{HOME}."/.config")."/imap-notify/config.toml")->slurp);
+Log::Log4perl->easy_init($ERROR);
if ($ARGV[0] // "" eq "--debug") {
- Log::Any::Adapter->set("Stderr", log_level => "trace");
+ Log::Log4perl->easy_init($TRACE);
+ #Log::Any::Adapter->set("Stderr", log_level => "trace");
+} else {
+ Log::Log4perl->easy_init($INFO);
}
+Log::Any::Adapter->set('Log4perl');
+
#$IO::Socket::SSL::DEBUG = 4;