commit 8851c7ffe6b88fb9a279460c29eb5fb15e19dc60 from: TheLion date: Thu Jul 06 01:02:50 2023 UTC docs: fix docs commit - f0df20090faec19faee3dbe89661fe4d43711e59 commit + 8851c7ffe6b88fb9a279460c29eb5fb15e19dc60 blob - 004bd712c8ba7d116b2920ad9176bc96f41fc11c blob + 8e8e0d50c41593c90f5426ed0917d82a4cdac206 --- README.md +++ README.md @@ -3,7 +3,7 @@ ## Logger -example usage: +Example usage: ```perl use strict; use warnings; @@ -32,9 +32,9 @@ $logger->error("error"); Arguments are: `verbosity, printType, format`. -### formating the logger +### Formating the logger -logger has these fields: +Logger has these fields: * timestamp * loglevel * package @@ -43,14 +43,14 @@ logger has these fields: * line * msg -prepend the field with a `:` and postfix the field with a `%` followed by a number. Add spaces in between. +Prepend the field with a `:` and postfix the field with a `%` followed by a number. Add spaces in between. ex: `:timestamp [:loglevel%5] :package%8 :fileline%10 :msg` -note: if your field value is longer than the specified length, it will print out the full value. -ex: -format: `:timestamp [:loglevel%2] :package%8 :fileline%10 :msg` +Note: If your field value is longer than the specified length, it will print out the full value. +EX: +Format: `:timestamp [:loglevel%2] :package%8 :fileline%10 :msg` result: ``` 2023-07-02 19:21:54 [DEBUG] main test.pl debug @@ -59,16 +59,16 @@ result: 2023-07-02 19:21:54 [ERROR] main test.pl error ``` -### sugar vs json +### SUGAR vs JSON -there are two options to print logs: +There are two options to print logs: * sugar * JSON JSON logging is meant for being picked up by services such as grafana or the elk stack. Sugar logging is meant for human readable output to stdout. -example of JSON: +Example of JSON: ``` { "level": "DEBUG", "msg": "debug", "package": "main", "file": "test.pl:12" } { "level": "INFO", "msg": "info", "package": "main", "file": "test.pl:13" } @@ -76,7 +76,7 @@ example of JSON: { "level": "ERROR", "msg": "error", "package": "main", "file": "test.pl:15" } ``` -example of Sugar: +Example of Sugar: ``` 2023-07-02 19:22:03 [DEBUG] main test.pl:12 debug 2023-07-02 19:22:03 [INFO ] main test.pl:13 info