5.1.0 • Published 7 months ago

@alexrah/logger v5.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
7 months ago

DISCLAIMER: not ready for production releases

logger - A simple console.log wrapper

Intallation

npm i @alexrah/logger

Features

  • custom prefix when creating instance const lg = new logger('custom prefix')
  • random coloured output
  • stack trace with const lg = new logger(); lg.s('traced output'')

Requirements NODE environment

  • create a .env file in the root directory
  • add constant LOG_LEVEL with a value between 1 and 6 LOG_LEVEL="6"

Requirements BROWSER environment

  • create a global object env window.env = {}
  • add constant LOG_LEVEL with a value between 1 and 6 window.env.LOG_LEVEL = '6';
LOG_LEVEL
ASSERT = 1;
ERROR = 2;
WARN = 3;
INFO = 4;
DEBUG = 5;
VERBOSE = 6

TODO

  • global setLevel with dotenv
  • now works only with window.console, add support to node console
  • testing: add jest deps and write tests
5.1.0

7 months ago

5.0.0

8 months ago

3.2.0

2 years ago

4.0.0

2 years ago

3.1.0

2 years ago

3.0.0

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago