# log-core

> 前端日志输出

Latest version **1.0.1** (published 2019-06-27) · LGPL-3.0-or-later license · 0 weekly downloads

## Install

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

## 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.1 |
| Published | 2019-06-27 |
| First published | 2019-06-26 |
| Weekly downloads | 0 |
| License | LGPL-3.0-or-later |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | 381888954@qq.com |
| Maintainers | lsdfly |
| Keywords | console, debug, Log-core, LogCore, log |

## Links

- npm: https://www.npmjs.com/package/log-core
- Repository: https://github.com/lsdfly/log-core
- npm.io page: https://npm.io/package/log-core

## 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.1 (latest) — 2019-06-27
- 1.0.0 — 2019-06-26

## README

```js
yarn add log-core
import LogCode from "log-core";
// 错误级别
LogCode.LEVEL_ERROR
//普通
LogCode.LEVEL_LOG
// 警告
LogCode.LEVEL_WARN
// 调试
LogCode.LEVEL_DEBUG
// 关闭
LogCode.LEVEL_OFF
LogCode.on(LogCode.LEVEL_ERROR, (err, msg) => {
    console.log('错误事件被触发');
    //异步上传到服务器记录
    new Image().src = `report?err=${err}&msg=${msg}`
})
// 只输出error事件
LogCode.setLevel(LogCode.LEVEL_ERROR)
const logCore = new LogCode('A页面');
logCore.debug('输出-debug')
logCore.log('输出-warn')
logCore.warn('输出-warn')
logCore.error('输出-error')
```

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