Remove unused code by lcov and add debug log