commit - 8851c7ffe6b88fb9a279460c29eb5fb15e19dc60
commit + a87809859709dc100c7e9ae2d2dcb6fc7dc14bb1
blob - 8e8e0d50c41593c90f5426ed0917d82a4cdac206
blob + d06136eca335d1956a11fc6d4481d1f842dffad0
--- README.md
+++ README.md
# IRCNOW lib
+* 1. [Logger](#Logger)
+ * 1.1. [Formating the logger](#Formatingthelogger)
+ * 1.2. [SUGAR vs JSON](#SUGARvsJSON)
+ * 1.3. [Loggin Verbosity](#LogginVerbosity)
-## Logger
+## 1. <a name='Logger'></a>Logger
+
Example usage:
```perl
use strict;
Arguments are: `verbosity, printType, format`.
-### Formating the logger
+### 1.1. <a name='Formatingthelogger'></a>Formating the logger
Logger has these fields:
* timestamp
2023-07-02 19:21:54 [ERROR] main test.pl error
```
-### SUGAR vs JSON
+### 1.2. <a name='SUGARvsJSON'></a>SUGAR vs JSON
There are two options to print logs:
* sugar
2023-07-02 19:22:03 [ERROR] main test.pl:15 error
```
+### 1.3. <a name='LogginVerbosity'></a>Logging Verbosity
+
+There are verbosity levels:
+* NONE
+* ERRORS
+* ERROR (backwards compatible)
+* WARNINGS
+* WARN (backwards compatible)
+* INFO
+* DEBUG
+* ALL
+
+Each level is in order such that if the `INFO` level was chosen, you would see logs for `ERROR`, `WARN`, and `INFO`
blob - f13ea4b61dbeea6682d0eab7b9aaecea3670291b
blob + 10c0ad62df7491a3a20b149706b9598991bf806c
--- lib/IRCNOW/Logger.pm
+++ lib/IRCNOW/Logger.pm
my $magenta = "\033[35m";
my $cyan = "\033[36m";
-our @EXPORT_OK = qw(debug info warn error NONE ERRORS WARNINGS INFO DEBUG ALL JSON SUGAR);
+our @EXPORT_OK = qw(debug info warn error NONE ERRORS ERROR WARNINGS WARN INFO DEBUG ALL JSON SUGAR);
use constant {
NONE => 0,
ERRORS => 1,
+ ERROR => 1,
WARNINGS => 2,
+ WARN => 2,
INFO => 3,
DEBUG => 4,
ALL => 5,
if ($level == NONE) {
$levelString = "NONE";
- } elsif ($level == ERRORS) {
+ } elsif ($level == ERROR) {
$levelString = "ERROR";
- } elsif ($level == WARNINGS) {
+ } elsif ($level == WARN) {
$levelString = "WARN";
} elsif ($level == INFO) {
$levelString = "INFO";