Make log imports conditional