# debugdi

> debug log package with auto prefixer, built for dependency injection frameworks

Latest version **0.1.1** (published 2022-08-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install debugdi
pnpm add debugdi
yarn add debugdi
bun add debugdi
```

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2022-08-04 |
| First published | 2022-07-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | nya1 |
| Maintainers | nya |
| Keywords | debug, log, inversify, ioc, depedency injection, inversion of control, log prefix |

## Links

- npm: https://www.npmjs.com/package/debugdi
- Repository: git@github.com:nya1/debugdi
- npm.io page: https://npm.io/package/debugdi

## Dependencies (1)

- [debug](https://npm.io/package/debug.md) ^4.3.4

## 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.1.1 (latest) — 2022-08-04
- 0.1.0 — 2022-07-14

## README

# debugdi

debug log package built for Inversify (dependency injection framework), **automatically** prefix your debug logs with the project name and class name

Example:

```ts
// package.json name "server"
// class TestService ...
debug.log('hello')
```

Logs (with DEBUG=server:*):

```
server:TestService hello
```

## Install

```bash
yarn add debugdi
```

## Usage

In your class inject the `DebugLog` class and call the log method, internally it's using the [debug](https://www.npmjs.com/package/debug) module so you need to enable the debug logs via the env variable `DEBUG=<project name>:*`

Example

```ts
export class TestService {
  constructor(@inject(DebugLog) private debug: DebugLog) {}

  myMethod(username: string) {
    this.debug.log(`hello ${username}`);
  }
}

// log output:
// <project name>:TestService hello <dynamic>
```

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