# mst-log

> A console logging middleware for MobX State Tree

Latest version **2.0.0** (published 2021-04-20) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2021-04-20 |
| First published | 2020-05-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 59.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 28 |
| Author | Mike Cann |
| Maintainers | mike.cann |

## Links

- npm: https://www.npmjs.com/package/mst-log
- Repository: https://github.com/mikecann/mst-log
- npm.io page: https://npm.io/package/mst-log

## Dependencies (2)

- [mobx](https://npm.io/package/mobx.md) ^6.2.0
- [mobx-state-tree](https://npm.io/package/mobx-state-tree.md) ^5.0.1

## Recent versions

- 2.0.0 (latest) — 2021-04-20
- 1.1.1 — 2020-10-18
- 1.1.0 — 2020-10-18
- 1.0.0 — 2020-05-19

## README

<a href="docs/images/screenshot01.png"><img src="docs/images/screenshot01.png"></a>

# MST Log

A console logging middleware for MobX State Tree

## Install

`yarn add mst-log`

## Usage

```typescript
import { addMiddleware, types } from "mobx-state-tree";
import { mstLog } from "mst-log";

// Create your store
const myStore = types.model({}).create({});

// Attach the middleware
addMiddleware(myStore, mstLog());
```

## Options

There are a few options you can provide to control how logging works:

```typescript
type Options = {
  getCallTypeColor: (type: IMiddlewareEventType) => string;
  getShouldGroupBeCollapsed: (call: IMiddlewareEvent) => boolean;
  logger: Logger;
  getTime: () => number;
};
```

If theres some aspect you would like to be able to change please do open a PR :)

## Thanks

Thanks go to the [redux-logger](https://github.com/LogRocket/redux-logger) library for the inspiration in this one.

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
  <tr>
    <td align="center"><a href="http://www.mikecann.co.uk"><img src="https://avatars3.githubusercontent.com/u/215033?v=4" width="100px;" alt=""/><br /><sub><b>Mike Cann</b></sub></a><br /><a href="https://github.com/mikecann/mst-flow-pipe/commits?author=mikecann" title="Code">💻</a></td>
  </tr>
</table>

<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

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