fix: synchronize logs, buffer events channel, exit on goroutine failure
- Add mutex to prevent interleaved log output from concurrent goroutines - Make logMsg delegate to logPrintf for consistent synchronization - Buffer events channel to size 1 with select/drop when full - Close events channel on ListenForTrainer exit so process terminates
This commit is contained in: