New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@hopin/logger

Package Overview
Dependencies
Maintainers
2
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hopin/logger

A simple console abstraction with some little extras

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
2
Weekly downloads
 
Created
Source

@hopin/logger

Travis Build 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>
hopin.logger.setPrefix('Example');

hopin.logger.debug('Doing some debugging?');
hopin.logger.info('I hope to provide info');
hopin.logger.log('I\'m a friendly log.');
hopin.logger.warn('Oops, I\'m an warning.');
hopin.logger.error('Eek! I\'m an error.');

hopin.logger.group('I can group logs together.');
hopin.logger.log('Message in a group....');
hopin.logger.log('....awesome sauce.');
hopin.logger.groupEnd();
</script>

For multiple loggers with seperate prefixes:

<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');

logger.setPrefix('Example');

logger.debug('Doing some debugging?');
logger.info('I hope to provide info');
logger.log('I\'m a friendly log.');
logger.warn('Oops, I\'m an warning.');
logger.error('Eek! I\'m an error.');

logger.group('I can group logs together.');
logger.log('Message in a group....');
logger.log('....awesome sauce.');
logger.groupEnd();

For multiple loggers with seperate prefixes:

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!');

Keywords

FAQs

Package last updated on 10 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc