function Logging.capture(b)local w=createLogInfo()local H=outputEnabled outputEnabled=false collectors[w]=true local V,P=pcall(b)collectors[w]=nil outputEnabled=H assert(V,P)return w end

function Logging.capture(callback)
	local collector = createLogInfo()

	local wasOutputEnabled = outputEnabled
	outputEnabled = false
	collectors[collector] = true

	local success, result = pcall(callback)

	collectors[collector] = nil
	outputEnabled = wasOutputEnabled

	assert(success, result)

	return collector
end
