logging: facade (hand-rolled async worker) + hot-path migration; drop TRUNK_DEBUG
Adds src/misc/Log.h / Log.cpp exposing geulog::{trace,debug,info,warn,error}
(subsystem, args...) with gate-before-format. Seven named loggers
(trunk, satellite, twin, client, mqtt, redis, core) share a mutex-guarded
deque drained by a single background worker thread writing to fd=1.
Levels come from [GLOBAL] LOG=*=warn,trunk=debug,... and are runtime-
settable via /dev/shm/reflector_ctrl (LOG SHOW / LOG sub=lvl / LOG RESET).
Writes continue to fd=1 so LogWriter file/syslog paths are unchanged.
Migrated hot paths only: audio relay, talker start/stop, handshake,
heartbeat, per-client RX, per-frame trunk/satellite/twin relay, plus the
ENOTCONN sendMsg race at ReflectorClient:302 (demoted to debug since it
is per-disconnect noise, not a fault).
Cold paths (startup banners, config validation, TLS/CA diagnostics,
MQTT/Redis publisher lifecycle) remain on raw cout/cerr and move in the
next commit.
TRUNK_DEBUG is removed; a startup warning points at LOG=trunk=debug.
This commit is contained in:
1 parent
59ae728713
commit
ccec8f1e95
14 files changed
+1131
-646
No files matched your search
@@ -181,8 +181,6 @@ class TrunkLink : public sigc::trackable
|
||||
Reflector* m_reflector;
|
||||
Async::Config& m_cfg;
|
||||
std::string m_section;
|
||||
bool m_debug = false;
|
||||
unsigned m_debug_frame_cnt = 0;
|
||||
std::string m_peer_host;
|
||||
uint16_t m_peer_port;
|
||||
std::string m_secret;
|
||||
|
||||
Reference in new issue
Block a user