Straightforward NodeJS logging. https://npmjs.com/package/@holllo/log
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Bauke 6d4debcf53
Version 1.1.3
2 weeks ago
source Make private methods protected so they can be overridden. 2 weeks ago
tests Make linting and testing pass. 2 weeks ago
.gitignore Move to self-hosted Gitea, update dependencies, clean up stuff. 1 year ago
.nycrc.json Move to self-hosted Gitea, update dependencies, clean up stuff. 1 year ago
CHANGELOG.md Version 1.1.3 2 weeks ago
LICENSE Move to self-hosted Gitea, update dependencies, clean up stuff. 1 year ago
README.md Version 1.1.3 2 weeks ago
package.json Version 1.1.3 2 weeks ago
tsconfig.json Move to self-hosted Gitea, update dependencies, clean up stuff. 1 year ago
yarn.lock Update dependencies. 2 weeks ago

README.md

Log

Straightforward NodeJS logging.

Features

  • Console logs are colorized with Chalk.
  • Uses Fecha for timestamp formatting.
  • Comes with rotating-file-stream as the default stream.
  • 4 levels to log under. Error, warn, info and debug.

Usage

Install Log.

yarn add @holllo/log

Create a Log instance.

import Log from '@holllo/log';

const log = new Log({
  level: Log.Levels.debug,
  name: 'Name'
});

Log to your heart’s content.

log.error('Oh no, an error!');
log.warn('Just a warning, no big deal.');
log.info('Some regular log stuff.');
log.debug('This shouldn\'t be in production. 🤔');

Check your logs in logs/${name}.log.

YYYY-MM-DD HH:mm:ss,SSS Error Oh no, an error!
YYYY-MM-DD HH:mm:ss,SSS Warn  Just a warning, no big deal.
YYYY-MM-DD HH:mm:ss,SSS Info  Some regular log stuff.
YYYY-MM-DD HH:mm:ss,SSS Debug This shouldn't be in production. 🤔

Changelog

Latest version (1.1.3) changes:

  • Updated the dependencies and tests.
  • Made the private methods from the Log class protected so it can be extended and made more custom.

The full changelog can be found here.

License

Open-sourced with the MIT license.