Skip to content

TomerAberbach/etz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

For pull requests, please read the contributing guidelines.

License

Apache 2.0

This is not an official Google product.