Logger
Date and prepend/append logs to your log file(s) with a simple function.
The documentation is available here.
Installation
-
With npm:
npm install --save purpl-logger
-
With yarn:
npm add purpl-logger
Usage
- Logging to
logs.txt
(default path):
const log = ; ;; // The most recent log will appear first in logs.txt
- Changing your log file (globally):
const logger = ; loggerpath = 'logs/my-log-file';logger; loggerpath = 'logs/my-other-log-file';logger;
- Specifying a log file to the log function:
const log = ; ;;