When someone writes a Microsoft.Extensions.Logging.ILogger.LogCritical() call, there must be some serious things happened. I hope it will (log critical and) break while run in debugger. I've try the answer of How to override an existing extension method, it requires special namespace using. But I hope that everyone can use LogCritical() naturally, no need to double check whether it's calling original LogCritical() or my trapped one.
The only way I can think of is replace the backing logging library with mine, and it redirect calls to logging library with my breaking logic. But this implement restrict to specified library. If I want to change library in the future, I need to implement another one. And implement all the boring interfaces it needs, just for a few LogCritical() related breaking logic.
So, I wish to trap the general ILogger.LogCritical() call, not the underlying concrete one. Is this possible?