> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meshagent.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Developer

## Overview

The `DeveloperClient` is the Room API for structured developer logs. Use it to send logs into the Developer Console and subscribe to live logs from other participants in the room.

## CLI commands

Start with the CLI help, then use the main live-log command:

```bash bash theme={null}
meshagent room developer --help
meshagent room developer --room myroom
```

## Why use the Developer API?

* Debug agents, tools, and services while a room is live.
* Send structured log payloads instead of plain text so downstream tools can filter or render them.
* Watch a room log stream from the CLI or SDK during development.

## How it works

The Developer API is event-oriented. Producers call `log` (or convenience helpers such as `info`) to emit structured events, and consumers call `logs()` to subscribe to the live stream.

## Permissions and grants

Developer logs are controlled by the `developer` grant on the participant token.

In practice, `developer.logs` enables emitting and consuming developer-log events for the room.

See [API Scopes](../rest_api/api_scopes) and [Service YAML](../services/deployment/deploy_services).

## Streaming Logs

* **`logs()`**
  Opens a streamed subscription to developer logs for the room. Stop receiving logs by closing the stream or breaking iteration.

<CodeGroup>
  ```bash CLI theme={null}
  meshagent room developer \
    --room myroom

  ```

  ```python Python theme={null}
  async for event in room.developer.logs():
      print(f"[{event.type}] {event.data}")

  ```

  ```javascript NodeJs theme={null}
  for await (const event of room.developer.logs()) {
    console.log(`[${event.type}]`, event.data);
  }

  ```

  ```typescript TypeScript theme={null}
  for await (const event of room.developer.logs()) {
    console.log(`[${event.type}]`, event.data);
  }

  ```

  ```dart Dart theme={null}
  await for (final event in room.developer.logs()) {
    print("[${event.type}] ${event.data}");
  }

  ```

  ```dotnet C# theme={null}
  await foreach (var log in room.Developer.Logs())
  {
    Console.WriteLine($"[{log.Type}] {log.Data}");
  }

  ```
</CodeGroup>

## API reference

Use the methods below to emit structured developer logs or subscribe to the live room log stream.

### `log(type, data)`

* **Description**: Emit a developer log event.
* **Parameters**:
  * `type`: A log category string (for example, `"info"` or `"error"`).
  * `data`: A JSON-serializable payload with any extra fields.
* **Returns**: `None`

<CodeGroup>
  ```python Python theme={null}
  await room.developer.log(type="info", data={"message": "Hello from DeveloperClient!"})

  ```

  ```javascript NodeJs theme={null}
  await room.developer.log("info", { message: "Hello from DeveloperClient!" });

  ```

  ```typescript TypeScript theme={null}
  await room.developer.log("info", { message: "Hello from DeveloperClient!" });

  ```

  ```dart Dart theme={null}
  await room.developer.log("info", {"message": "Hello from DeveloperClient!"});

  ```

  ```dotnet C# theme={null}
  await room.Developer.Log("info", new Dictionary<string, object?>
  {
    ["message"] = "Hello from DeveloperClient!"
  });

  ```
</CodeGroup>

### `log_nowait(type, data)`

* **Description**: Fire-and-forget log emission without awaiting a response.
* **Availability**: Python and .NET SDKs.
* **Parameters**:
  * `type`: A log category string.
  * `data`: A JSON-serializable payload.
* **Returns**: `None`

<CodeGroup>
  ```python Python theme={null}
  room.developer.log_nowait(type="info", data={"message": "Log without await"})

  ```

  ```dotnet C# theme={null}
  room.Developer.LogNowait("info", new Dictionary<string, object?>
  {
    ["message"] = "Log without await"
  });

  ```
</CodeGroup>

### `info(...)`, `warning(...)`, `error(...)`

* **Description**: Convenience helpers for emitting structured logs with common severity labels.
* **Availability**: Python and Dart SDKs.
* **Parameters**:
  * `message`: Human-readable text.
  * `extra` *(optional)*: Additional fields to include with the log.
* **Returns**: `None`

<CodeGroup>
  ```python Python theme={null}
  room.developer.info("Background sync started", extra={"phase": "init"})
  room.developer.warning("Retrying sync", extra={"attempt": 2})
  room.developer.error("Sync failed", extra={"reason": "timeout"})

  ```

  ```dart Dart theme={null}
  await room.developer.info("Background sync started", extra: {"phase": "init"});
  await room.developer.warning("Retrying sync", extra: {"attempt": 2});
  await room.developer.error("Sync failed", extra: {"reason": "timeout"});

  ```
</CodeGroup>

### `logs()`

* **Description**: Open a streamed subscription to developer logs for the room.
* **Parameters**: None.
* **Returns**: A stream / async iterator of log events.

<CodeGroup>
  ```bash CLI theme={null}
  meshagent room developer \
    --room myroom

  ```

  ```python Python theme={null}
  async for event in room.developer.logs():
      print(event.type, event.data)

  ```

  ```javascript NodeJs theme={null}
  for await (const event of room.developer.logs()) {
    console.log(event.type, event.data);
  }

  ```

  ```typescript TypeScript theme={null}
  for await (const event of room.developer.logs()) {
    console.log(event.type, event.data);
  }

  ```

  ```dart Dart theme={null}
  await for (final event in room.developer.logs()) {
    print(event.type);
  }

  ```

  ```dotnet C# theme={null}
  await foreach (var log in room.Developer.Logs())
  {
    Console.WriteLine(log.Type);
  }

  ```
</CodeGroup>

## Related guides

* [Room API Overview](./overview)
* [Observability Overview](../observability/overview)
* [API Scopes](../rest_api/api_scopes)
