# log-horizon

> A fancy logger for CLI apps.

Latest version **0.1.2** (published 2018-04-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install log-horizon
pnpm add log-horizon
yarn add log-horizon
bun add log-horizon
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2018-04-10 |
| First published | 2018-02-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 2 |
| Unpacked size | 7.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 62 |
| Author | egoist |
| Maintainers | rem |

## Links

- npm: https://www.npmjs.com/package/log-horizon
- Repository: https://github.com/egoist/log-horizon
- npm.io page: https://npm.io/package/log-horizon

## Dependencies (2)

- [chalk](https://npm.io/package/chalk.md) ^2.3.1
- [log-update](https://npm.io/package/log-update.md) ^2.3.0

## Recent versions

- 0.1.2 (latest) — 2018-04-10
- 0.1.1 — 2018-03-06
- 0.1.0 — 2018-02-28
- 0.0.0 — 2018-02-27

## README

# log-horizon

[![NPM version](https://img.shields.io/npm/v/log-horizon.svg?style=flat)](https://npmjs.com/package/log-horizon) [![NPM downloads](https://img.shields.io/npm/dm/log-horizon.svg?style=flat)](https://npmjs.com/package/log-horizon) [![CircleCI](https://circleci.com/gh/egoist/log-horizon/tree/master.svg?style=shield&circle-token=d372afd8d560fb9522f85d967ba19e998a8ee321)](https://circleci.com/gh/egoist/log-horizon/tree/master)  [![donate](https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000&style=flat)](https://github.com/egoist/donate) [![chat](https://img.shields.io/badge/chat-on%20discord-7289DA.svg?style=flat)](https://chat.egoist.moe)

## Install

```bash
yarn add log-horizon
```

## Usage

```js
const LogHorizon = require('log-horizon')

const logger = new LogHorizon()
```

Check out the [example code](./examples/_log.js), preview:

<img src="https://cdn.rawgit.com/egoist/93995ac552ac66d38631ed4bff1d7cc1/raw/cf167f27e4033aff5be32115c4c313ebca885703/preview-log-horizon.svg" width="600" alt="preview">

## API

### new LogHorizon(options)

### options

#### options.logLevel

Type: `number`<br>
Default: `3`

- `1`: `error`
- `2`: `warn`
- `3`: `info`
- `4`: `debug`

#### options.debug

Type: `boolean`

A shortcut to set `options.logLevel` to `4`.

#### options.quiet

Type: `boolean`

A shortcut to set `options.logLevel` to `1`.

#### options.logUpdate

Type: `boolean`<br>
Default: `true`

Use `log-update` module instead of `console.log`.

#### options.statusType

Type: `string`<br>
Default: `'emoji'`<br>
Possible values: `'emoji'` `'badge'` `'text'`

### Methods

#### logger.setOptions(options)

#### logger.success(message)

#### logger.error(message)

#### logger.warn(message)

#### logger.debug(message)

#### logger.progress(message)

#### logger.log(message, update = false)

#### logger.status(status, message, update = false)

## Contributing

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D


## Author

**log-horizon** © [egoist](https://github.com/egoist), Released under the [MIT](./LICENSE) License.<br>
Authored and maintained by egoist with help from contributors ([list](https://github.com/egoist/log-horizon/contributors)).

> [github.com/egoist](https://github.com/egoist) · GitHub [@egoist](https://github.com/egoist) · Twitter [@_egoistlily](https://twitter.com/_egoistlily)

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