1.4.0 • Published 4 years ago

@pdiddyb/logger v1.4.0

Weekly downloads
-
License
Apache
Repository
-
Last release
4 years ago

logger

Javascript logger repo with various levels based on environment variables and colors in chrome

Installation

npm install @pdiddyb/logger

Configuration

If you want to see all messages even traces and color logs, you will need to set an environment variable LOG_LEVEL to dev. This assumes you are using webpack and declaring environment variables that are accessed in your application using process.env.VARIABLE. If not, then you will get all logging messages and will not be able to just use trace and color in certain environments.

LOG_LEVEL=dev

If you want to only see one color of color logs, then you need to set an environment variable LOG_COLOR=your color to see

LOG_COLOR=cyan

Usage

import Log from @pdiddyb/logger
...
Log.trace('This is a trace which will only show if LOG_LEVEL is dev.');
Log.color('This is just like trace but you specify the color.', 'cyan');
Log.info('This is an info message and will always show');
Log.warn('This is a warning message and will always show');
Log.error('This is an error and will always show');
1.4.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.3.0

4 years ago

0.1.0

4 years ago

0.2.0

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago