android: real utun instance + SQLite channels + reactive logs + QR join
- instance_lite.h/c: full uTun stack from INI config text (keygen, uasync, UTUN_INSTANCE, SQLite, chat_core/sync, BGP, etcp_router) - jni_bridge: nativeStart/Stop, nativeJoinChannel → chat_sync_connect_from_invite, nativeSubscribeLogs, C logs → logcat + Kotlin LogManager - Kotlin: direct read-only SQLite queries (channels, messages), ViewModel with live event callbacks, reactive LogScreen (tail -f), CameraX QR scanner with proper lifecycle, JoinChannelDialog - HeadlessService: generates INI config from Kotlin settings → C instance
This commit is contained in:
1 parent
d1f6f6fca9
commit
5276c1288c
25 files changed
+2444
-63
No files matched your search
@@ -210,6 +210,7 @@ const char* debug_get_category_name(debug_category_t category_idx) {
|
||||
|
||||
/* Global debug configuration */
|
||||
debug_config_t g_debug_config;
|
||||
static debug_log_hook_fn g_log_hook = NULL;
|
||||
|
||||
/* Initialize debug system with default settings */
|
||||
void debug_config_init(void) {
|
||||
@@ -433,6 +434,12 @@ void debug_output(debug_level_t level, debug_category_t category_idx,
|
||||
|
||||
va_end(args);
|
||||
|
||||
/* Route to external hook (JNI bridge, etc.) */
|
||||
if (g_log_hook) {
|
||||
const char* cat_name = debug_get_category_name(category_idx);
|
||||
g_log_hook((int)level, cat_name, buffer);
|
||||
}
|
||||
|
||||
/* Output to console if enabled and level is sufficient */
|
||||
if (g_debug_config.file_output) {
|
||||
fprintf(g_debug_config.file_output, "%s", buffer);
|
||||
@@ -444,6 +451,10 @@ void debug_output(debug_level_t level, debug_category_t category_idx,
|
||||
#undef BUFFER_SIZE
|
||||
}
|
||||
|
||||
void debug_set_log_hook(debug_log_hook_fn hook) {
|
||||
g_log_hook = hook;
|
||||
}
|
||||
|
||||
/* Parse debug configuration from string (e.g., "ll_queue:debug,uasync:info,memory:warn,etcp:error") */
|
||||
int debug_parse_config(const char* config_string) {
|
||||
if (!config_string || !*config_string) {
|
||||
|
||||
@@ -157,6 +157,10 @@ void debug_output(debug_level_t level, debug_category_t category_idx,
|
||||
const char* function, const char* file, int line,
|
||||
const char* format, ...);
|
||||
|
||||
/* Log hook — if set, called with every debug message (for JNI/bridge integration) */
|
||||
typedef void (*debug_log_hook_fn)(int level, const char* category, const char* message);
|
||||
void debug_set_log_hook(debug_log_hook_fn hook);
|
||||
|
||||
/* Parse debug configuration from string (e.g. "etcp=trace,config=info") */
|
||||
int debug_parse_config(const char* config_string);
|
||||
|
||||
|
||||
Reference in new issue
Block a user