# id.log

> Id.log is an alternative to console.log, with some powerful features !

Latest version **2.0.6** (published 2017-10-29) · CC-BY-NC-SA-4.0 license · 0 weekly downloads

## Install

```sh
npm install id.log
pnpm add id.log
yarn add id.log
bun add id.log
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.6 |
| Published | 2017-10-29 |
| First published | 2017-05-19 |
| Weekly downloads | 0 |
| License | CC-BY-NC-SA-4.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Arthur Lacoste |
| Maintainers | arthak |
| Keywords | console.log, util, log, logger, timestamp, is-dev |

## Links

- npm: https://www.npmjs.com/package/id.log
- Repository: https://github.com/arthurlacoste/id.log
- Homepage: https://github.com/arthurlacoste/id.log#readme
- Issues: https://github.com/arthurlacoste/id.log/issues
- npm.io page: https://npm.io/package/id.log

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 2.0.6 (latest) — 2017-10-29
- 2.0.5 — 2017-10-29
- 2.0.4 — 2017-10-28
- 2.0.3 — 2017-10-28
- 2.0.2 — 2017-10-28
- 2.0.1 — 2017-10-28
- 2.0.0 — 2017-10-28
- 1.1.0 — 2017-09-30
- 1.0.3 — 2017-05-19
- 1.0.2 — 2017-05-19
- 1.0.1 — 2017-05-19
- 1.0.0 — 2017-05-19

## README

# id.log
id.log is a Node.JS module, alternative to console.log, with some powerful features !

[![NPM Version][npm-version]][npm-url]
[![travis][travis-badge]][travis-url]
![CircleCI Build Status][circle-badge]
[![xo][xo-badge]][xo-url]

## Install

```
npm install id.log --save
```

## Usage

```js
const id = require('id.log');
id.log('Hello dudes !');
// =>  2017-10-28 10:48:37 - Hello dudes !
```


### isDev() : set your current environment

You can play with isDev, like [electron-is-dev](https://github.com/sindresorhus/electron-is-dev) :

```js
id.isDev(false);
id.log('No dev env');
// No output in prod env

id.isDev(true);
id.log('Dev env Hell YEAH');
// =>  2017-10-28 10:48:37 - Dev env Hell YEAH
```

Or like this :

```js
if(process.env.NODE_ENV === 'production') {
	id.isDev(false);
}
id.log('Dev env Hell YEAH');
```

You can edit all the arguments by passing an object to `id()` :

### Setup all options

The better way to do it :

```js
const args = {
	id: 'goodid',
	date: true,
	separator: '🦄',
	quietMode: false,
	priority: 9  // all messages > 9 are displayed
};

id(args);

id.log('Dev env Hell YEAH');
// Goodid 🦄 2017-10-28 10:48:37 🦄 Dev env Hell YEAH
```

You can change everything :

* id: not used by default, but useful for socket instances
* date: true, by default, but you can set it to false
* separator: default to `'-'`, but you can use a beautiful unicorn emoji `'🦄'`
* quietMode: false by default, you can handle it with `isDev()`, or set it with the main way. As **YOU** want !
* priority: set a minimum indicator for the quiet mode. By default, you set the priority on 5. This mean, if you send this log `id.log('message', 4)`, we don't display it.

## Licence
[CC-BY-NC-SA-4.0](https://creativecommons.org/licenses/by-sa/4.0/) - Arthur Lacoste


[npm-version]:https://img.shields.io/npm/v/id.log.svg
[npm-url]: https://npmjs.org/package/id.log
[travis-badge]: http://img.shields.io/travis/arthurlacoste/id.log.svg
[travis-url]: https://travis-ci.org/arthurlacoste/id.log
[circle-badge]: https://circleci.com/gh/arthurlacoste/id.log.svg?style=shield
[xo-badge]: https://img.shields.io/badge/code_style-XO-5ed9c7.svg
[xo-url]: https://github.com/sindresorhus/xo

---
_Source: https://npm.io/package/id.log · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
