easy.log.js

1.0.0 • Public • Published

easy.log.js

A good log module for browser.More convenient and elegant.

Feature

  • print every log with a group name, then you can filter logs in console tab
  • every log has stack info, easily for debugging
  • you can turn off logging for all groups or specific group

Install

Recommended way is by npm

npm install --save easy.log.js

Also support using by script

<script src="dist/easy.log.js"></script>

Usage

For webpack project

import LOG from 'easy.log.js'
let log1 = LOG("group-name-1");
log1("log");
log1.log("log");
log1.warn("warn");
log1.error("error");

For normal script insert usage, easy.log.js export one global variable named LOG

let log1 = LOG("group-name-1");
// ...

Tip

easy.log.js is just for browsers.
Though easy.log.js can run in nodejs environment, you could not need it. Try log4js, it can write logs to file.

License

MIT

Package Sidebar

Install

npm i easy.log.js

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

17.8 kB

Total Files

10

Last publish

Collaborators

  • hejie