File

mod_log_rate/mod_log_rate.lua @ 2215:e276ed33bc1a

mod_http_upload/README: Simplify instructions, show only one method
author Kim Alvefur <zash@zash.se>
date Fri, 24 Jun 2016 14:35:14 +0200
parent 2202:217456783219
child 2243:f388747c53c7
line wrap: on
line source

module:set_global();

local function sink_maker(config)
	local levels = {
		debug = measure("log.debug", "rate");
		info = measure("log.info", "rate");
		warn = measure("log.warn", "rate");
		error = measure("log.error", "rate");
	};
	return function (_, level)
		return levels[level]();
	end
end

require"core.loggingmanager".register_sink_type("measure", sink_maker);