# log1

> log for global、env or debug

Latest version **1.0.7** (published 2016-05-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install log1
pnpm add log1
yarn add log1
bun add log1
```

## 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 | 1.0.7 |
| Published | 2016-05-25 |
| First published | 2016-05-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | i5ting |
| Maintainers | i5ting |

## Links

- npm: https://www.npmjs.com/package/log1
- Repository: https://github.com/i5ting/log1
- Homepage: https://github.com/i5ting/log1#readme
- Issues: https://github.com/i5ting/log1/issues
- npm.io page: https://npm.io/package/log1

## Dependencies (1)

- [debug](https://npm.io/package/debug.md) ^2.2.0

## Recent versions

- 1.0.7 (latest) — 2016-05-25
- 1.0.6 — 2016-05-25
- 1.0.4 — 2016-05-25
- 1.0.3 — 2016-05-25
- 1.0.2 — 2016-05-25
- 1.0.0 — 2016-05-25

## README

# log1 = log for global、env or debug


[![Build](https://travis-ci.org/i5ting/log1.svg?branch=master)](https://travis-ci.org/i5ting/log1) [![npm version](https://badge.fury.io/js/log1.svg)](http://badge.fury.io/js/log1)


make all console.xx to global

- log
- info
- warn
- error
- dir
- time
- timeEnd
- trace
- assert
- debug(optional https://github.com/visionmedia/debug)

## global log

```
require('log1')

log('global log')
```

## global log with env

```
require('log1')()

log('global log')
```

when `NODE_ENV=production`，will not print any log

```
export NODE_ENV=production && node test.js
```

otherwise，print log

## global log disable

```
require('log1')(true)

log('global log')
```

this will not print any log

```
export NODE_ENV=production && node test/log-disable.js
```

## use debug module

https://github.com/visionmedia/debug

### use log1 namespace as default

```
require('log1')()

var name = 'My App'

debug('booting %s', name);
```

exec show debug info

```
$ export DEBUG=log1 && node test/debug.js
log1 booting My App +0ms
```

### use custom namespace

```
require('log1')(true, 'namespace')

var name = 'My App'

debug('booting %s', name);
```

exec show debug info

```
$ export DEBUG=namespace && node test/custom-debug.js
namespace custom booting My App +0ms
```

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