switching log thread safety