# Debug

### Imports

{% tabs %}
{% tab title="Service" %}

```typescript
import { DebugService } from 'niro-health';
```

{% endtab %}

{% tab title="Module" %}

```typescript
import { DebugModule } from 'niro-health';
```

{% endtab %}

{% tab title="Interface" %}

```typescript
import type { IDebugService } from 'niro-health';
```

{% endtab %}
{% endtabs %}

### Method of Use

To use this module, you need to inject it into the desired service.

{% code overflow="wrap" %}

```typescript
import { Module } from '@nestjs/common';
import {
  DebugService,
} from 'niro-health';
import { AppController } from './app.controller';
import { AppService } from './app.service';

@Module({
  controllers: [AppController],
  providers: [
    AppService,
    {
      provide: 'IDebugService',
      useClass: DebugService,
    },
  ],
})
export class AppModule {}
```

{% endcode %}

Injecting the module into our service.

```typescript
import { Inject, Injectable } from '@nestjs/common';
import type { IDebugService } from 'niro-health';

@Injectable()
export class AppService {
  constructor(
    @Inject('IDebugService')
    private readonly debugService: IDebugService,
  ) {}

  public log(text: string) {
    return this.debugService.log(text);
  }
}
```

### Without dependencies

You won't need to connect the pieces with any other module.

### Methods

<table><thead><tr><th width="301.3333333333333">Method</th><th width="129" align="center">Scope</th><th>Description</th></tr></thead><tbody><tr><td><code>log</code></td><td align="center"><code>public</code></td><td><code>The method logs a message with the level </code><mark style="color:green;"><code>log</code></mark><code>.</code></td></tr><tr><td><code>warn</code></td><td align="center"><code>public</code></td><td><code>The method logs a message with the level </code><mark style="color:orange;"><code>warn</code></mark><code>.</code></td></tr><tr><td><code>error</code></td><td align="center"><code>public</code></td><td><code>The method logs a message with the level </code><mark style="color:red;"><code>error</code></mark><code>.</code></td></tr><tr><td><code>debug</code></td><td align="center"><code>public</code></td><td><code>The method logs a message with the level </code><mark style="color:purple;"><code>debug</code></mark><code>.</code></td></tr><tr><td><code>verbose</code></td><td align="center"><code>public</code></td><td><code>The method logs a message with the level </code><mark style="color:orange;"><code>verbose</code></mark><code>.</code></td></tr></tbody></table>
