view mod_log_rate/mod_log_rate.lua @ 4442:74da3643c62d

mod_smacks: Don't ask for acks while in (csi) inactive mode The acks count as high priority events in mod_csi_simple and since they're sent after each stanza, it negated all optimizations.
author Kim Alvefur <zash@zash.se>
date Tue, 16 Feb 2021 19:16:21 +0100
parents f388747c53c7
children
line wrap: on
line source

module:set_global();

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

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