https://github.com/tomeraberbach/etz
🌴 A humble logger.
https://github.com/tomeraberbach/etz
logger logging npm-module
Last synced: over 1 year ago
JSON representation
🌴 A humble logger.
- Host: GitHub
- URL: https://github.com/tomeraberbach/etz
- Owner: TomerAberbach
- License: apache-2.0
- Created: 2021-11-05T22:45:37.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-15T03:29:44.000Z (over 1 year ago)
- Last Synced: 2025-03-16T15:54:18.416Z (over 1 year ago)
- Topics: logger, logging, npm-module
- Language: TypeScript
- Homepage: https://npm.im/etz
- Size: 504 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- Contributing: contributing.md
- License: license
Awesome Lists containing this project
README
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](#faq)
## Install
```sh
$ npm i etz
```
## Usage
**index.js**:
```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`:
```shell
$ node index.js
ℹ INFO Hello World!
âš WARN Hello World!
✖ ERROR Hello World!
```
Set the log level with the `ETZ` environment variable:
```shell
$ 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`:
```shell
$ 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](https://github.com/TomerAberbach/etz/issues/new).
For pull requests, please read the
[contributing guidelines](https://github.com/TomerAberbach/etz/blob/main/contributing.md).
## License
[Apache License 2.0](https://github.com/TomerAberbach/etz/blob/main/license)
This is not an official Google product.