> For the complete documentation index, see [llms.txt](https://docs.boii.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.boii.dev/fivem-free-resources/bdtk/api/modules/debugging.md).

# Debugging

{% hint style="warning" %}
**SHARED FUNCTIONS**
{% endhint %}

## log

Prints a formatted debug message to the console.

#### parameters

* level: `string`
* message: `string`

```lua
bdtk.log(level, message)
```

***

## wait\_for

Waits until a given function returns true or a timeout is reached.

#### parameters

* fn: `function`
* timeout: `number|nil`
* interval: `number|nil`

#### returns

* `boolean`

```lua
bdtk.wait_for(fn, timeout, interval)
```
