Skip to content

Commit

Permalink
[misc] set correct coverage goal
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Feb 8, 2024
1 parent 4211558 commit 2eb246d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ coverage:
status:
project:
default:
target: auto
target: 85% # the required coverage value
threshold: 1%
39 changes: 39 additions & 0 deletions src/test/java/org/mariadb/jdbc/unit/util/log/LoggersTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,43 @@ public void Slf4JLogger() throws IOException {

reader.close();
}

@Test
void noLoggerFactory() {
System.setProperty(Loggers.NO_LOGGER_PROPERTY, "true");
Loggers.init();
try {
Logger logger = Loggers.getLogger(LoggersTest.class);
assertFalse(logger.isErrorEnabled());
assertFalse(logger.isWarnEnabled());
assertFalse(logger.isInfoEnabled());
assertFalse(logger.isDebugEnabled());
assertFalse(logger.isTraceEnabled());
assertEquals("", logger.getName());

logger.error("Test err1");
logger.error("Test err2", new SQLException("test exception"));
logger.error("Test err3 {}", "param");

logger.warn("Test warn 1");
logger.warn("Test warn 2", new SQLException("test exception"));
logger.warn("Test warn 3 {}", "param");

logger.info("Test info 1");
logger.info("Test info 2", new SQLException("test exception"));
logger.info("Test info 3 {}", "param");

logger.debug("Test debug 1");
logger.debug("Test debug 2", new SQLException("test exception"));
logger.debug("Test debug 3 {}", "param");

logger.trace("Test trace 1");
logger.trace("Test trace 2", new SQLException("test exception"));
logger.trace("Test trace 3 {}", "param");

} finally {
System.clearProperty(Loggers.NO_LOGGER_PROPERTY);
Loggers.init();
}
}
}

0 comments on commit 2eb246d

Please sign in to comment.