Would this be better to just move into `SparkContext`? Then you don't need to have this live check. Also, the idea of enabling logging is really something that is not specific to the SparkUI but might be used for other things as well.