local url = os.getenv("MCP_HTTP_URL")
assert(url and url ~= "", "MCP_HTTP_URL must be set")
mcp.connect_http("nillog", url)
print("CONNECT_HTTP_OK")
local log_hits = 0
mcp.on_log("nillog", function(ev)
log_hits = log_hits + 1
assert(ev ~= nil, "ev must not be nil")
assert(ev.server ~= nil, "server must not be nil")
assert(ev.level ~= nil, "level must not be nil")
assert(ev.logger ~= nil, "logger must not be nil after normalisation")
assert(type(ev.logger) == "string", "logger must be a string, got: " .. type(ev.logger))
assert(ev.data ~= nil, "data must not be nil after normalisation")
print("LOG_EV_OK")
end)
local r = mcp.call("nillog", "emit_log_nil", {})
assert(r.ok == true, "emit_log_nil call failed: " .. tostring(r.error))
print("CALL_OK")
std.task.sleep(300)
print(string.format("LOG_HITS=%d", log_hits))
assert(log_hits >= 1, "log_hits must be >= 1, got: " .. tostring(log_hits))
print("FIXTURE_DONE")