2.1.2 • Published 11 months ago

@tanand-tech/logger v2.1.2

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

@tanand-tech/logger

Version Documentation Maintenance

tslog wrapper for tanand-tech internal usage

Homepage

Usage

Installation

npm install @tanand-tech/logger

Set Log Level

const logger = require('@tanand-tech/logger');

const log1 = logger('LOG');
log.setLogLevel('info');

const log2 = logger('LOG').setLogLevel('info');

const { info, error } = logger('LOG').setLogLevel('info');

Enable filepath

// Unix
LOGGER_DISPLAY_FILE_PATH=true npm run start

// Windows
set LOGGER_DISPLAY_FILE_PATH=true npm run start

// Cross-env
cross-env LOGGER_DISPLAY_FILE_PATH=true npm run start

Enable minimum name padding

// Unix
LOGGER_MIN_PAD=16 npm run start

// Windows
set LOGGER_MIN_PAD=16 npm run start

// Cross-env
cross-env LOGGER_MIN_PAD=16 npm run start

Configure log levels

// Unix
LOGGER_MIN_LEVEL=3 npm run start
LOGGER_MIN_LEVEL=info npm run start

// Windows
set LOGGER_MIN_LEVEL=3 npm run start
set LOGGER_MIN_LEVEL=info npm run start

// Cross-env
cross-env LOGGER_MIN_LEVEL=3 npm run start
cross-env LOGGER_MIN_LEVEL=info npm run start
Log Levels (In order of priority)
  1. Fatal
  2. Error
  3. Warn
  4. Info
  5. Debug
  6. Trace
  7. Silly

Author

tanand-tech

Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page.

2.1.2

11 months ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.6

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.3

3 years ago

1.1.0

3 years ago