onUninstall

protected open fun onUninstall()(source)

Helper for implementations to clean up any resources at time of Root.uninstall. This is called after the Log has been removed from the list of available Log, and is done so while holding a lock. Implementations should be thread-safe, fast, non-blocking, and not throw exception.

NOTE: log and isLoggable may still be called for a brief period after this function has been invoked by a Log.Root uninstall function. There exists a potential scenario, especially with multithreaded programs, that a Logger may be mid-dispatch of its log when this Log instance was subsequently uninstalled. The only guarantees that can be made at the point in time when this function is invoked, are:

  • The list returned by Log.Root.installed will not contain this Log instance.

  • Any invocations of Logger logging functions going forward will not have this Log instance available.

  • onInstall will not be called until after this function returns.