From f7513a81e379e3ef4c6946c7e5536fef1616c21b Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 6 Aug 2018 14:07:17 +0200 Subject: Use Log4perl for timestamps in output Signed-off-by: Florian Pritz --- script/imap-notify.pl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'script') 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 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; -- cgit v1.2.3-24-g4f1b