commit f0df20090faec19faee3dbe89661fe4d43711e59 from: TheLion date: Thu Jul 06 01:02:50 2023 UTC docs: update docs commit - 923b1a5885e0ebbe4058e357c435562363e30c7a commit + f0df20090faec19faee3dbe89661fe4d43711e59 blob - 1ababa0d3f534edc8b95512bbcf48edca76ed90c blob + 004bd712c8ba7d116b2920ad9176bc96f41fc11c --- README.md +++ README.md @@ -9,15 +9,20 @@ use strict; use warnings; use lib qw(./lib); -use Logger; +use IRCNOW::Logger; -my $logger = new Logger(Logger->SUGAR, ":timestamp [:loglevel%5] :package%8 :fileline%10 :msg"); +my $logger = new IRCNOW::Logger(IRCNOW::Logger->INFO, IRCNOW::Logger->SUGAR); +#my $logger = new IRCNOW::Logger(IRCNOW::Logger->DEBUG, IRCNOW::Logger->SUGAR); +#my $logger = new Logger(IRCNOW::Logger->DEBUG, Logger->SUGAR, ":loglevel :timestamp :msg"); +#my $logger = new Logger(IRCNOW::Logger->DEBUG, Logger->SUGAR, ":loglevel :invalid :timestamp :msg"); +#my $logger = new Logger(IRCNOW::Logger->DEBUG, Logger->SUGAR, ":timestamp [:loglevel%2] :package%8 :file%10 :msg"); $logger->debug("debug"); $logger->info("info"); $logger->warn("warn"); $logger->error("error"); + # output: # 2023-07-02 19:22:03 [DEBUG] main test.pl:12 debug # 2023-07-02 19:22:03 [INFO ] main test.pl:13 info @@ -25,6 +30,8 @@ $logger->error("error"); # 2023-07-02 19:22:03 [ERROR] main test.pl:15 error ``` +Arguments are: `verbosity, printType, format`. + ### formating the logger logger has these fields: