README
sloggin
Sloggin is one of the easiest ways to log a Node program.
Step 1:
In the terminal, type npm i -S sloggin
Step 2:
At the top of your root Javascript file, write
const Logger = require('sloggin').Logger;
const logger = new Logger(__dirname);
Step 3:
To write something in the logs, you need to call one of 5 functions; logger.info(string, show_in_terminal (default = true)
, logger.success(string, show_in_terminal (default = true)
, logger.warning(string, show_in_terminal (default = true)
, logger.error(string, show_in_terminal (default = true)
or logger.fatal(string, error, show_in_terminal(default = true)
. Info prints out plain text into the terminal, with the prefix [*]
, success prints out green text into the terminal with the prefix [•]
, warning prints out yellow text into the terminal with the prefix [!]
, error prints out red text into the terminal with the prefix [#]
and fatal prints out bold, red text into the terminal with the prefix [X]
.