# 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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guilhermesantos.gitbook.io/niro-health/modules/debug.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
