From 16546e5818408f35adc60c2d937cf4541ff7840a Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 28 Oct 2026 12:24:10 +0100 Subject: Logging: per-session file and debug-gated verbose logs - Open /tmp/hl2hake.log once in the library constructor with "w" so each session starts clean, use line buffering, flush each line, and close it via atexit. No more fopen/fclose per message. - Add logd() for verbose diagnostics, enabled only with HL2H_DEBUG=1. - Move ESP/NPC scans, item-prop/item-classification logs, aimbot/silent-aim/ melee/triggerbot/spread details, jumpbug tracking, bone dumps, netvar dumps, cmd-modified and ground-trace noise to logd(). - Keep logf() for lifecycle, config, warnings/errors, GUI open/close, item category/tagging summaries and item-crate detections so crate debugging works without the ESP stream. - Supply crates now respect the max-distance slider (user change), with the stale comment and CONTEXT updated. - Document HL2H_DEBUG=1 in play.sh and CONTEXT. --- CONTEXT.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'CONTEXT.md') diff --git a/CONTEXT.md b/CONTEXT.md index 737a6b2..7a1ee33 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -258,6 +258,15 @@ vocabulary / decisions. assist deliberately writes only `m_vecAbsVelocity`; `SetAbsVelocity` syncs `m_vecVelocity` after the command. +## Logging + +- `/tmp/hl2hake.log` is opened once at startup with `"w"` (so it only contains + the current session), line-buffered, and closed via `atexit`. +- `logf` is always on: lifecycle, warnings/errors, config, GUI open/close and + item-crate detections. +- `logd` is off unless `HL2H_DEBUG=1`; it carries per-scan ESP/NPC/item-prop, + aimbot-target, bone and netvar noise. Run `HL2H_DEBUG=1 ./play.sh` to enable. + ## Gotchas / lessons - Never pipe-mask build failures: @@ -275,9 +284,8 @@ vocabulary / decisions. - Scans the client entity list every 100 ms and tags health, ammo, armor/suit, world weapon pickups, the two supply-crate models and generic items. - Each tag is a colored marker with a name and optional distance, filtered by - category toggles and a max-distance slider (default 5000 units). Supply - crates ignore the distance limit. Drawn through walls and independently of - the hostile NPC ESP. + category toggles and a max-distance slider (default 5000 units). Drawn + through walls and independently of the hostile NPC ESP. - Ammo labels are specific where the model is known: pistol, SMG, AR2, .357, crossbow, shotgun, sniper, flares, AR2 grenade, RPG rocket, plus ammo-crate variants. Unknown ammo falls back to "Ammo". -- cgit v1.2.3