1.0.6 • Published 4 years ago

purpl-logger v1.0.6

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

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 } = require('purpl-logger');

log('My first log');
log('My second log'); // The most recent log will appear first in logs.txt
  • Changing your log file (globally):
const logger = require('purpl-logger');

logger.path = 'logs/my-log-file';
logger.log('Logging to my-log-file');

logger.path = 'logs/my-other-log-file';
logger.log('Logging to my-other-log-file');
  • Specifying a log file to the log function:
const { log } = require('purpl-logger');

log('Logging to my-logs.txt', 'my-logs.txt');
log('Logging to logs/some-file.log', 'logs/some-file.log');
1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago