mirror of
https://github.com/fromchat-messenger/app.git
synced 2026-09-22 19:15:05 +03:00
87934c7448
Signed-off-by: denis0001-dev <denis0001.dev@ya.ru>
17 lines
909 B
Plaintext
17 lines
909 B
Plaintext
---
|
|
description: Use Ktor HttpClient for debug-mode logging instead of platform APIs
|
|
alwaysApply: true
|
|
---
|
|
|
|
# Debug-mode logging with Ktor
|
|
|
|
- Prefer **Ktor `HttpClient`** for all debug/instrumentation HTTP logging in this project.
|
|
- **Do NOT** use `HttpURLConnection`, raw `OkHttpClient`, or other low-level networking APIs for debug-only logging.
|
|
- Centralize debug logging behind `ru.fromchat.debug.DebugLogger` and keep it **best-effort only** (never throw, never crash the app).
|
|
- When adding new debug logging:
|
|
- Use a shared `HttpClient` instance (per platform) configured with the appropriate engine (e.g. OkHttp on Android).
|
|
- Send JSON NDJSON-style payloads to the configured debug endpoint.
|
|
- Avoid blocking the main thread; run network I/O in coroutines on a background dispatcher.
|
|
- Keep debug logging code small and self-contained so it is easy to remove or disable when no longer needed.
|
|
|