# Debug mode

> Turn on debug mode in Tamr's AI waiter SDK to log every bridge message, request and tap between the waiter page and your app, and inspect the webview in debug builds.

Source: https://tamr.link/docs/guides/debugging

Turn debug mode on with `debug: true` (`debug = true` on Android, `data-debug="1"` on the web's script tag), and optionally pass an `onLog` function to receive the lines yourself. Turn it off in release builds.

## What it logs

Every message both ways, every request the page makes with its status and time, every tap with the element under it, and errors, one line each:

Log lines:

```text
[tamr] page <level>: <message>
[tamr] shell: <message>
```

`page` lines come from the waiter page, `shell` lines from the SDK in your app. Without `onLog` they go to the platform's log:

| Platform | Where |
| --- | --- |
| Web, React Native | The console |
| Flutter | `debugPrint` |
| iOS | The system log, subsystem `link.tamr.waiter` |
| Android | `Log.d`, tag `TamrWaiter` |

**Never logged:** diner tokens, launch codes and session tokens (they show as `[redacted]`), query strings, and anything the diner typed.

## Inspecting the webview

In a debug build of your app, debug mode also makes the webview inspectable: Safari's Web Inspector on iOS 16.4+, `chrome://inspect` on Android. From each SDK's next release a release build never is, even with `debug` on, since inspection would expose the diner's session; until then, keep `debug` off in release builds.

## Reading a dead tap

A `press` line with no `click` after it is a tap the page never finished. No `press` at all means the tap never reached the page: look at your own view over the webview.

## Before you write code

The **host simulator** (**Settings > App keys > Host simulator**) shows every message between the page and an app, with its own test key, before your app exists.
