Rough implementation of channel filters 'Channel' object.#46
Rough implementation of channel filters 'Channel' object.#46bbbscarter wants to merge 1 commit intomasterfrom
Conversation
|
@Kalmalyzer @astruyk feel free to pull this apart. :) Also, I'm thinking:
|
|
Thanks for making an example implementation! I was swamped with other things at work so it took some time until I could give this a look. This setup makes sense to me by and large. I have one primary concern and that has to do with naming: A "Filter" is something that filters things - some things are let through, other things are stopped. Some filters are particular in that they let certain things through - other filters are particular in that they stop certain things. So what does "UberLogger.FilterWarnings" mean? Does it mean, "stop warnings" or does it mean "pass through warnings and stop everything else"? I prefer naming which makes that explicit. Example would be naming these as "StopWarnings" or "MuteWarnings", or "SuppressWarnings" (my personal preference). I'm not 100% happy with those either but I prefer any of those over "FilterWarnings". The config line is pretty long too. I think it would be good to provide a couple of static lists with names like "SuppressMessages", "SuppressMessagesAndWarnings", "SuppressAll" which then contain appropriate filtering operations. Muting a channel entirely can then be done via: so this would make the common muting options as easy to use as enums. With regards to IFilter interface vs delegate, I think it would be preferable to have it be a delegate instead of an interface. I set it up as an interface primarily because I wasn't familiar enough with delegates at that time. Finally, namespaces. Yes, I think this is a good time to move it all into a namespace, existing users be damned :) |
Wrote this on a plane after drinking gin, so needs scrutiny.