Here is one way to do it. I used mutate_if in case your actual data frame has some columns that are not numeric. Are you sure that it is ok to effectively replace all of your zeros with ones in the pre-log data set?
DF <- data.frame(A = log(c(0, 2,0)), B = log(c(1,0,5)), C = log(c(4,4,0)))
DF
#> A B C
#> 1 -Inf 0.000000 1.386294
#> 2 0.6931472 -Inf 1.386294
#> 3 -Inf 1.609438 -Inf
library(dplyr)
DF <- DF %>% mutate_if(is.numeric, function(x) ifelse(is.infinite(x), 0, x))
DF
#> A B C
#> 1 0.0000000 0.000000 1.386294
#> 2 0.6931472 0.000000 1.386294
#> 3 0.0000000 1.609438 0.000000
Created on 2019-11-05 by the reprex package (v0.2.1)