etz
v2.0.1
Published
A humble logger.
Downloads
643
Maintainers
Readme
Features
- Humble: it just prints pretty filterable logs to the console!
- Filtering: use
ETZ
andNO_ETZ
environment variables to filter - Cool Name: just three letters transliterated from Hebrew
Install
$ npm i etz
Usage
index.js:
import etz from 'etz'
etz.debug(`Hello World!`)
etz.info(`Hello World!`)
etz.warn(`Hello World!`)
etz.error(`Hello World!`)
Log level
NOTE: The examples below are not colorized, but they will be in your terminal!
The default log level is INFO
:
$ node index.js
ℹ INFO Hello World!
⚠ WARN Hello World!
✖ ERROR Hello World!
Set the log level with the ETZ
environment variable:
$ node index.js
ℹ INFO Hello World!
⚠ WARN Hello World!
✖ ERROR Hello World!
$ ETZ=0 node index.js
★ DEBUG Hello World!
ℹ INFO Hello World!
⚠ WARN Hello World!
✖ ERROR Hello World!
$ ETZ=debug node index.js
★ DEBUG Hello World!
ℹ INFO Hello World!
⚠ WARN Hello World!
✖ ERROR Hello World!
$ ETZ=3 node index.js
★ DEBUG Hello World!
ℹ INFO Hello World!
⚠ WARN Hello World!
✖ ERROR Hello World!
$ ETZ=error node index.js
✖ ERROR Hello World!
Suppress all logs with NO_ETZ
:
$ NO_ETZ=1 node index.js
The value of NO_ETZ
doesn't matter. Any value works.
FAQ
What's with the name?
The Hebrew word for tree, wood, and most importantly log is "עץ", which is pronounced like "etz".
Contributing
Stars are always welcome!
For bugs and feature requests, please create an issue.
For pull requests, please read the contributing guidelines.
License
This is not an official Google product.