# uc-log

> Log mixin with levels of verbosity

Latest version **1.0.0** (published 2018-06-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install uc-log
pnpm add uc-log
yarn add uc-log
bun add uc-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 | 1.0.0 |
| Published | 2018-06-26 |
| First published | 2018-06-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alexey Novikov |
| Maintainers | velocityzen |
| Keywords | unchained, ui, browser, log, logger, kiss |

## Links

- npm: https://www.npmjs.com/package/uc-log
- Repository: https://github.com/unchainedui/log
- Homepage: https://github.com/unchainedui/log#readme
- Issues: https://github.com/unchainedui/log/issues
- npm.io page: https://npm.io/package/uc-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

- 1.0.0 (latest) — 2018-06-26

## README

# Unchained UI

## Log

[![NPM Version](https://img.shields.io/npm/v/uc-log.svg?style=flat-square)](https://www.npmjs.com/package/uc-log)
[![NPM Downloads](https://img.shields.io/npm/dt/uc-log.svg?style=flat-square)](https://www.npmjs.com/package/uc-log)

Log mixin with levels of verbosity

### Usage

```js
import compose from 'uc-compose'
import { log, LOG_LEVEL } from 'uc-log'

const MyClass = function() {}
MyClass.prototype = compose(
  log,
  {
    logLevel: LOG_LEVEL.DEBUG,
    logName: 'My Class',
    method: function() {
      this.log(LOG_LEVEL.INFO, 'Hello')
    }
  }
)
```

### Methods

#### log(level, ...args)

Logs all `args` into console if `level` is smaller than `logLevel` property of the class.

### Properties

* **logLevel** - number, defines the maximum log level to be printed out
* **logName** - string, if defined will be prepended to every log line

### LEVELS

```js
const LOG_LEVEL = {
  NONE: 0,
  ALERT: 1,
  CRITICAL: 2,
  ERROR: 3,
  WARNING: 4,
  NOTICE: 5,
  INFO: 6,
  DEBUG: 7,
  ALL: 255
}
```

License MIT

© velocityzen

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