Enhance logging and add policy test client
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled

- Refactored logOutput function to trace-log stdout and stderr lines for better debugging.
- Introduced a new policy test client in cmd/policytest/main.go to publish events and check policy responses.
- Added a script to run the policy test, ensuring proper cleanup and error handling.
- Updated policy event processing to ensure newline-terminated JSON for compatibility with shell-readers.
This commit is contained in:
2025-10-20 16:30:39 +01:00
parent 105e372712
commit 65e8ab4fbe
6 changed files with 137 additions and 17 deletions

View File

@@ -374,14 +374,9 @@ func (r *Client) ConnectWithTLS(
if env, message, err = okenvelope.Parse(message); chk.E(err) {
continue
}
if okCallback, exist := r.okCallbacks.Load(string(env.EventID)); exist {
eventIDHex := hex.Enc(env.EventID)
if okCallback, exist := r.okCallbacks.Load(eventIDHex); exist {
okCallback(env.OK, env.ReasonString())
} else {
// log.I.F(
// "{%s} got an unexpected OK message for event %0x",
// r.URL,
// env.EventID,
// )
}
}
}