# babel-plugin-ima-logger

> The babel pluging that removes @ima/plugin-logger from source code at compilation time.

Latest version **4.0.1** (published 2023-01-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-ima-logger
pnpm add babel-plugin-ima-logger
yarn add babel-plugin-ima-logger
bun add babel-plugin-ima-logger
```

## Health

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

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2023-01-20 |
| First published | 2019-11-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Ondrej Base |
| Maintainers | mjancarik, filipoliko |
| Keywords | IMA.js, Logger, Plugin, Javascript |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-ima-logger
- Repository: https://github.com/seznam/IMA.js-plugins
- Homepage: https://github.com/seznam/IMA.js-plugins#readme
- Issues: https://github.com/seznam/IMA.js-plugins/issues
- npm.io page: https://npm.io/package/babel-plugin-ima-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
- [@luma.gl/experimental](https://npm.io/package/@luma.gl/experimental.md) — 77.1K 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

## Recent versions

- 4.0.1 (latest) — 2023-01-20
- 5.0.0-rc.2 (rc) — 2023-02-18
- 5.0.0-rc.1 — 2023-02-17
- 5.0.0-rc.0 — 2023-02-17
- 4.0.0 — 2022-12-15
- 4.0.0-rc.9 — 2022-12-01
- 4.0.0-rc.8 — 2022-11-08
- 4.0.0-rc.7 — 2022-11-07
- 4.0.0-rc.6 — 2022-11-07
- 4.0.0-rc.5 — 2022-10-31
- 4.0.0-rc.4 — 2022-10-28
- 4.0.0-rc.3 — 2022-10-27
- 4.0.0-rc.2 — 2022-10-14
- 4.0.0-rc.1 — 2022-09-22
- 3.1.0-rc.0 — 2022-08-12
- … 5 more at https://npm.io/package/babel-plugin-ima-logger/versions

## README

# babel-plugin-ima-logger

[babel-plugin-ima-logger](https://github.com/seznam/IMA.js-plugins/tree/master/packages/babel-plugin-ima-logger) removes call expressions and function names in import statements of
[@ima/plugin-logger](https://github.com/seznam/IMA.js-plugins/tree/master/packages/plugin-logger) plugin
when used in production or when the plugin's [`remove` option](#remove) is set to `true`.

## Installation

```javascript

npm install babel-plugin-ima-logger --save-dev

```

```javascript
// gulpConfig.js

var gulpConfig = require('@ima/gulp-tasks/gulpConfig.js');

gulpConfig.babelConfig.esVendor.plugins.push('ima-logger');
gulpConfig.babelConfig.vendor.plugins.push('ima-logger');
gulpConfig.babelConfig.serverApp.plugins.push('ima-logger');
gulpConfig.babelConfig.esApp.plugins.push('ima-logger');
gulpConfig.babelConfig.app.plugins.push('ima-logger');
gulpConfig.babelConfig.server.plugins.push('ima-logger');

```

## What the plugin does

### It removes call expressions

The following call expressions will be removed:
- `debug(...)`
- `info(...)`
- `log(...)`
- `throwIf(...)`
- `warn(...)`

### It replaces call expressions with `0`

The following call expressions will be replaced by `0`:
- `debugIf(...)`
- `errorIf(...)`
- `infoIf(...)`
- `logIf(...)`
- `rejectIf(...)`,
- `warnIf(...)`

### Removes function names from import statements of @ima/plugin-logger

The following function names will be removed from the import statements:
- `debug`
- `debugIf`
- `errorIf`
- `info`
- `infoIf`
- `log`
- `logIf`
- `rejectIf`
- `throwIf`
- `warn`
- `warnIf`

Empty import statements of @ima/plugin-logger will be removed completely.

## Options

### `remove`

`boolean`, defaults to `false`

If it's set to `true`, the plugin removes the call expressions and the function
names from import statements regardless of `process.env.NODE_ENV` value. If
it's set to `false`, `process.env.NOD_ENV` must be `'prod'` or `'production'` so
that the plugin could remove something.

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