Is it possible to suppress logging errors?
In the intellij-community codebase, there are lots of explicit calls to LOG.assertTrue(someCondition). For example if my plugin invokes ScrollingModelImpl.removeVisibleAreaListener(), but I don't care if the removal succeeds, there doesn't seem to be a way to suppress this error from being displayed to users. What's worse, there is no way to check if the ScrollingModel has a particular VisibleAreaListener attached, so I cannot check whether the error will occur beforehand.
请先登录再写评论。
You could suppress ERROR messages from the corresponding log category in the log4j properties, but I wouldn't recommend that. Instead, I'd try to make sure you're removing a listener that was added. If you control that listener, it should be relatively easy to remember somewhere (your plugin's internal state, or editor's user data) if the listener has been added to the editor.