chatgui: clean up log — remove spam, move messages to proper categories
A-B: Remove gui_bridge_post_uasync_fn log, MainWindow::onMessageReceived, InputBar send text B1: Move lifecycle messages to GENERAL (utun_node, main, mainwindow, animtimer, sound_manager, messagelist, db_manager) B2: Move chat events to CHAT_SYNC (MSG_RECEIVED, CHANNEL_UPDATED, CHANNEL_PEERS_ONLINE, DB_READY) B3: Move peer/connect events to MEMBER_SYNC (CONNECT_RESULT, NEW_PEER, AUTO_CONNECT, NODE_CHANGED) C: Lower level of C-side spam (recalc, send OK, PUSH ACK, connect_channel) INFO->DEBUG D: Fix duplicate PUSH log line in db_sync.c E: Add debounce to CHANNEL_PEERS_ONLINE — log only on change Misc: Remove sort=0 from ChannelList::loadChannels, improve DB_READY message
This commit is contained in:
1 parent
be0e76c9a6
commit
5feeb2c169
12 files changed
+49
-58
No files matched your search
@@ -102,7 +102,7 @@ void UtunNode::stop() {
|
||||
|
||||
void UtunNode::finalize() {
|
||||
if (!m_instance) return;
|
||||
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "finalize: cleanup start");
|
||||
DEBUG_INFO(DEBUG_CATEGORY_GENERAL, "finalize: cleanup start");
|
||||
etcp_router_bind(m_instance, ETCP_RT_ID_CHAT, nullptr);
|
||||
chat_sync_destroy(m_instance);
|
||||
chat_core_destroy(m_instance);
|
||||
@@ -110,7 +110,7 @@ void UtunNode::finalize() {
|
||||
m_instance = nullptr;
|
||||
uasync_destroy(m_ua, 0);
|
||||
m_ua = nullptr;
|
||||
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "finalize: cleanup done");
|
||||
DEBUG_INFO(DEBUG_CATEGORY_GENERAL, "finalize: cleanup done");
|
||||
}
|
||||
|
||||
void UtunNode::send(uint64_t dstNodeId, const QByteArray& data) {
|
||||
@@ -283,8 +283,7 @@ void UtunNode::runLoop() {
|
||||
}
|
||||
|
||||
/* chatgui defaults: suppress spam, verbose for our categories */
|
||||
g_debug_config.category_levels[DEBUG_CATEGORY_MEMORY] = DEBUG_LEVEL_DISABLED;
|
||||
g_debug_config.category_levels[DEBUG_CATEGORY_TIMING] = DEBUG_LEVEL_DISABLED;
|
||||
g_debug_config.category_levels[DEBUG_CATEGORY_SYS] = DEBUG_LEVEL_DISABLED;
|
||||
g_debug_config.category_levels[DEBUG_CATEGORY_BGP] = DEBUG_LEVEL_INFO;
|
||||
|
||||
/* per-category overrides from config: cat=level,cat=level,... */
|
||||
@@ -360,9 +359,9 @@ void UtunNode::runLoop() {
|
||||
sqlite3_exec(m_instance->topo_sqlite_db, "PRAGMA synchronous=NORMAL", NULL, NULL, NULL);
|
||||
sqlite3_exec(m_instance->topo_sqlite_db, "PRAGMA wal_autocheckpoint=10000", NULL, NULL, NULL);
|
||||
topo_node_sqlite_init(m_instance->topo_sqlite_db);
|
||||
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "SQLite (shared): %s db=%p", db_file, (void*)m_instance->topo_sqlite_db);
|
||||
DEBUG_INFO(DEBUG_CATEGORY_GENERAL, "SQLite (shared): %s db=%p", db_file, (void*)m_instance->topo_sqlite_db);
|
||||
} else {
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_DEBUG, "SQLite open failed: %s rc=%d", db_file, rc);
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_GENERAL, "SQLite open failed: %s rc=%d", db_file, rc);
|
||||
if (m_instance->topo_sqlite_db) { sqlite3_close(m_instance->topo_sqlite_db); m_instance->topo_sqlite_db = NULL; }
|
||||
}
|
||||
}
|
||||
@@ -381,7 +380,7 @@ void UtunNode::runLoop() {
|
||||
}
|
||||
|
||||
{ int sock_count = 0; for (struct ETCP_SOCKET* s = m_instance->etcp_sockets; s; s = s->next) sock_count++;
|
||||
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "utun_node: after instance_init, etcp_sockets=%d conns=%d",
|
||||
DEBUG_INFO(DEBUG_CATEGORY_GENERAL, "utun_node: after instance_init, etcp_sockets=%d conns=%d",
|
||||
sock_count, queue_entry_count(m_instance->connections)); }
|
||||
|
||||
etcp_router_bind(m_instance, ETCP_RT_ID_CHAT, recvCallback);
|
||||
@@ -398,8 +397,8 @@ void UtunNode::runLoop() {
|
||||
chat_sync_init(m_instance);
|
||||
chat_core_sync_my_addresses();
|
||||
|
||||
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "chat_core + chat_sync initialized");
|
||||
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "utun_node: entering poll loop");
|
||||
DEBUG_INFO(DEBUG_CATEGORY_GENERAL, "chat_core + chat_sync initialized");
|
||||
DEBUG_INFO(DEBUG_CATEGORY_GENERAL, "utun_node: entering poll loop");
|
||||
|
||||
signal(SIGINT, signal_handler);
|
||||
signal(SIGTERM, signal_handler);
|
||||
@@ -408,11 +407,11 @@ void UtunNode::runLoop() {
|
||||
uasync_poll(ua, 100);
|
||||
}
|
||||
|
||||
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "runLoop: poll exit m_stop=%d", (int)m_stop);
|
||||
DEBUG_INFO(DEBUG_CATEGORY_GENERAL, "runLoop: poll exit m_stop=%d", (int)m_stop);
|
||||
|
||||
signal(SIGINT, SIG_DFL);
|
||||
signal(SIGTERM, SIG_DFL);
|
||||
|
||||
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "runLoop: emitting stopped");
|
||||
DEBUG_INFO(DEBUG_CATEGORY_GENERAL, "runLoop: emitting stopped");
|
||||
QMetaObject::invokeMethod(this, [this] { emit stopped(); });
|
||||
}
|
||||
Reference in new issue
Block a user