Comparison

mod_log_ringbuffer/mod_log_ringbuffer.lua @ 5876:133b23758cf6

mod_log_ringbuffer: Hook POSIX signals via event only
author Kim Alvefur <zash@zash.se>
date Sat, 02 Mar 2024 15:11:20 +0100
parent 4226:df2ccb42a241
child 5877:97c9b76867ca
comparison
equal deleted inserted replaced
5875:dde9d21a599f 5876:133b23758cf6
104 local function handler() 104 local function handler()
105 dump_buffer(dump, sink_config.filename or get_filename(sink_config.filename_template)); 105 dump_buffer(dump, sink_config.filename or get_filename(sink_config.filename_template));
106 end 106 end
107 107
108 if sink_config.signal then 108 if sink_config.signal then
109 require "util.signal".signal(sink_config.signal, handler); 109 module:hook_global("signal/"..sink_config.signal, handler);
110 elseif sink_config.event then 110 elseif sink_config.event then
111 module:hook_global(sink_config.event, handler); 111 module:hook_global(sink_config.event, handler);
112 end 112 end
113 113
114 return function (name, level, message, ...) 114 return function (name, level, message, ...)