# mougrim-logger

> Mougrim logger

Latest version **0.0.4** (published 2020-02-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install mougrim-logger
pnpm add mougrim-logger
yarn add mougrim-logger
bun add mougrim-logger
```

## 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.0.4 |
| Published | 2020-02-08 |
| First published | 2019-02-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 57.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Mougrim |
| Maintainers | mougrim |
| Keywords | logger, log, logging, log4js |

## Links

- npm: https://www.npmjs.com/package/mougrim-logger
- Repository: https://github.com/mougrim/js-logger
- Issues: https://github.com/mougrim/js-logger/issues
- npm.io page: https://npm.io/package/mougrim-logger

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

- 0.0.4 (latest) — 2020-02-08
- 0.0.3 — 2019-09-05
- 0.0.2 — 2019-02-11

## README

This is Mougrim logger library.

Main theme - light and fast library, with simple configuring.

[![Latest Stable Version](https://img.shields.io/npm/v/mougrim-logger.svg)](https://npmjs.org/package/mougrim-logger)

## Configuration

```js
import Logger from 'mougrim-logger';

Logger.configure({
    defaultLoggerConfig: {
        minLevel: Logger.LEVEL_NOTICE,
    },
    loggers: {
        foo: {
            maxLevel: Logger.LEVEL_NOTICE,
        },
        bar: {
            minLevel: Logger.LEVEL_INFO,
            maxLevel: Logger.LEVEL_NOTICE,
        }
    },
});
```

## Logging

```js
import Logger from 'mougrim-logger';

let logger = Logger.getLogger('foo'); // minLevel will be from default config, maxLevel will be from loggers config
logger.debug('debug message', {foo: 'bar'}); // will be skipped
logger.info('info message', {foo: 'bar'}); // will be skipped
logger.notice('notice message', {foo: 'bar'}); // will be logged
logger.warning('warning message', {foo: 'bar'}); // will be skipped
logger.error('error message', {foo: 'bar'}); // will be skipped
logger.critical('critical message', {foo: 'bar'}); // will be skipped

logger = Logger.getLogger('bar'); // minLevel and maxLevel will be from loggers config
logger.debug('debug message', {foo: 'bar'}); // will be skipped
logger.info('info message', {foo: 'bar'}); // will be logged
logger.notice('notice message', {foo: 'bar'}); // will be logged
logger.warning('warning message', {foo: 'bar'}); // will be skipped
logger.error('error message', {foo: 'bar'}); // will be skipped
logger.critical('critical message', {foo: 'bar'}); // will be skipped

logger = Logger.getLogger('baz'); // default config will be used
logger.debug('debug message', {foo: 'bar'}); // will be skipped
logger.info('info message', {foo: 'bar'}); // will be skipped
logger.notice('notice message', {foo: 'bar'}); // will be logged
logger.warning('warning message', {foo: 'bar'}); // will be logged
logger.error('error message', {foo: 'bar'}); // will be logged
logger.critical('critical message', {foo: 'bar'}); // will be logged
```

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