## ⚡ Features
- No [dependencies](https://npm.anvaka.com/#/view/2d/diary)
- Outstanding [performance](#-benchmark)
- Support for [`debug`'s filter](https://www.npmjs.com/package/debug#wildcards)
## ⚙️ Install
```sh
npm add diary
```
## 🚀 Usage
```ts
import { info, diary, enable } from 'diary';
// 1️⃣ Choose to enable the emission of logs, or not.
enable('*');
// 2️⃣ log something
info('this important thing happened');
// ~> ℹ info this important thing happened
// Maybe setup a scoped logger
const scopedDiary = diary('my-module', (event) => {
if (event.level === 'error') {
Sentry.captureException(event.error);
}
});
// 3️⃣ log more things
scopedDiary.info('this other important thing happened');
// ~> ℹ info [my-module] this other important thing happened
```