# 3h-log

> A logger lib.

Latest version **3.1.2** (published 2020-06-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install 3h-log
pnpm add 3h-log
yarn add 3h-log
bun add 3h-log
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.1.2 |
| Published | 2020-06-01 |
| First published | 2018-02-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | 3h |
| Maintainers | 3h |
| Keywords | log, level, prefix, error, warn, info, debug, console, 3h |

## Links

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

## Dependencies (1)

- [3h-time](https://npm.io/package/3h-time.md) ^1.2.1

## 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

- 3.1.2 (latest) — 2020-06-01
- 3.1.1 — 2018-08-06
- 3.1.0 — 2018-07-08
- 3.0.1 — 2018-06-23
- 3.0.0 — 2018-06-23
- 2.0.3 — 2018-05-12
- 2.0.2 — 2018-02-18
- 2.0.1 — 2018-02-17
- 2.0.0 — 2018-02-17
- 1.1.4 — 2018-02-17
- 1.1.3 — 2018-02-17
- 1.1.2 — 2018-02-17
- 1.1.1 — 2018-02-17
- 1.1.0 — 2018-02-17
- 1.0.1 — 2018-02-10
- … 1 more at https://npm.io/package/3h-log/versions

## README

# 3h-log

A logger lib.

# Features

- Log with formatted time stamps (using `3h-time`)
- Log with various prefixes
- Log level control

# Example

```javascript

const Logger = require('3h-log'),
    logger = new Logger({ timeFormat: '[YYYY-MM-DD HH:mm:SS.sss]' });

logger.print('custom', 'Custom messages.');

logger.setLevel('log');

logger.error('Some errors.');
logger.warn('Some warnings.');
logger.info('Some infomation.');
logger.log('Some logs.');
logger.debug('This should not be seen!');

```

# APIs

Just read the type declaration files in [`typings`](typings) to learn the APIs.

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