How to exclude lcov branches within a macro
the new lcov version 1.11 (or 1.12) introduce LCOV_EXCL_BR_LINE keyword. So in your case:
LOG_MSG(ERROR, "An Error has occurred\n"); //LCOV_EXCL_BR_LINE
or, even better:
LOG_MSG(ERROR, "An Error has occurred\n"); (void)("LCOV_EXCL_BR_LINE");
which survives precompiler comment stripping.