🌴 A humble logger.
APACHE-2.0 License
ETZ
and NO_ETZ
environment variables to filter$ npm i etz
index.js:
import etz from 'etz'
etz.debug(`Hello World!`)
etz.info(`Hello World!`)
etz.warn(`Hello World!`)
etz.error(`Hello World!`)
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.
The Hebrew word for tree, wood, and most importantly log is "×¢×¥", which is pronounced like "etz".
Stars are always welcome!
For bugs and feature requests, please create an issue.
For pull requests, please read the contributing guidelines.
This is not an official Google product.