@hopin/logger

A simple console abstraction with some little extras

Stats

StarsIssuesVersionUpdatedCreatedSize
@hopin/logger
542.0.133a month ago3 years agoMinified + gzip package size for @hopin/logger in KB

Readme

@hopin/logger

Build and Publish Status Coverage Status

`hopin-logger` is a simply and small library aimed at making it easy to add colored and prefixed logs to a project in both Node 8+ and the browser.

Jake Rainbow

Usage in Browser

<script src="https://unpkg.com/@hopin/logger@0.0.5/dist/iife/browser/browser.js"></script>
<script>
const example1Logger = new hopin.logger.Logger({
  prefix: 'Example 1',
});
const example2Logger = new hopin.logger.Logger({
  prefix: 'Example 2',
});

example1Logger.debug('Hello Logger 2 *waves*');
example2Logger.log('Oh Hai!');
</script>

Usage in Node

const {Logger} = require('@hopin/logger');

const example1Logger = new Logger({
  prefix: 'Example 1',
});
const example2Logger = new Logger({
  prefix: 'Example 2',
});

example1Logger.debug('Hello Logger 2 *waves*');
example2Logger.log('Oh Hai!');

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.