-function setwriter(f)
- local old_func = outfunction;
- if not f then outfunction = nil; return true, old_func; end
- local ok, ret = pcall(f, "logger", "info", "Switched logging output successfully");
- if ok then
- outfunction = f;
- ret = old_func;
+function reset()
+ for k in pairs(name_sinks) do name_sinks[k] = nil; end
+ for level, handler_list in pairs(level_sinks) do
+ -- Clear all handlers for this level
+ for i = 1, #handler_list do
+ handler_list[i] = nil;
+ end