Enhance logging and add policy test client
- 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:
@@ -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,
|
||||
// )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user