Skip to content

TomerAberbach/etz

Repository files navigation

etz

A humble logger.

Features

  • Humble: it just prints pretty filterable logs to the console!
  • Filtering: use ETZ and NO_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.

License

MIT © Tomer Aberbach
Apache 2.0 © Google

About

🌴 A humble logger.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
license-apache
MIT
license-mit

Stars

Watchers

Forks

Sponsor this project