@tanand-tech/logger
v2.1.2
Published
tslog wrapper for tanand-tech internal usage
Downloads
17
Readme
@tanand-tech/logger
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)
- Fatal
- Error
- Warn
- Info
- Debug
- Trace
- Silly
Author
tanand-tech
- Github: @tanand-tech
Contributing
Contributions, issues and feature requests are welcome!
Feel free to check issues page.