I have in mind something that looks like this:
var log_routes = {
interactive_error: show_in_minibuffer,
error: dumpln,
warning: dumpln
};
function log (type, text, context) {
var logfn = log_routes[type] || dumpln;
logfn(text, context);
}
Any given function in log_routes receives both the text and a context object. The context object would
include properties like "buffer" and "window" when relevant. This means that the interactive context,
"I", could be used also as a log context.
|