# improved-logging

> Easy to use logging

Latest version **3.4.0** (published 2024-08-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install improved-logging
pnpm add improved-logging
yarn add improved-logging
bun add improved-logging
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.4.0 |
| Published | 2024-08-03 |
| First published | 2022-08-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 22.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | andreyha |
| Keywords | node, log, logging, console, colored console, chalk |

## Links

- npm: https://www.npmjs.com/package/improved-logging
- npm.io page: https://npm.io/package/improved-logging

## 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.4.0 (latest) — 2024-08-03
- 3.3.0 — 2024-08-03
- 3.2.1 — 2024-07-29
- 3.2.0 — 2024-07-29
- 3.0.1 — 2024-07-28
- 3.0.0 — 2024-07-28
- 2.1.10 — 2023-01-08
- 2.1.8 — 2023-01-08
- 2.1.7 — 2023-01-08
- 2.1.6 — 2023-01-08
- 2.1.5 — 2023-01-08
- 2.1.4 — 2022-12-30
- 2.1.3 — 2022-12-30
- 2.1.2 — 2022-11-22
- 2.1.1 — 2022-11-01
- … 17 more at https://npm.io/package/improved-logging/versions

## README

# Node.js module for logging into console, file and browser (see below for more info) 

# Installation
### Node package manager
```
npm i improved-logging
```
### YARN
```
yarn add improved-logging
```

# Usage:
```javascript
import logging from 'improved-logging'

logging.info('This is logging example')
```

## Log types
```javascript
import logging from 'improved-logging'

logging.info('Some information')
logging.important('Some important information')
logging.success('Something is done')
logging.warn('Warning')
logging.error('Something went wrong')
logging.fatal('Critical error')
```

## Enable logging into the files
```javascript
import logging from 'improved-logging'

logging.setLogfileName(path.join(__dirname, '../', 'logs', 'main.log'))

logging.info('Now will log all to file')

logging.setSeparateLogsByDate(true)

logging.info('This log will be located in MONTH_YYYY/DD.log')
```

## How to turn different logs on/off
```javascript
import logging from 'improved-logging'

logging.verbose('You will see this in console')

logging.setLogLevel('info')

logging.verbose('This one is hidden')


logging.setLogLevel('important')

logging.important('Now info, success and verbose logs are hidden')
logging.info('You will not see this in console/log file/browser')
```

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