提交 baa510d5 authored 作者: Noel Grandin's avatar Noel Grandin 提交者: GitHub

Merge pull request #516 from StephanErb/slow-slf4j

Properly reflect SLF4J log levels in TraceSystem.isEnabled(level)
......@@ -25,6 +25,8 @@ Change Log
</li>
<li>Issue #426: Support ANALYZE TABLE statement
</li>
<li>Issue #438: Fix slow logging via SLF4J (TRACE_LEVEL_FILE=4).
</li>
<li>Issue #472: Support CREATE SEQUENCE ... ORDER as a NOOP for Oracle compatibility
</li>
</ul>
......
......@@ -146,6 +146,9 @@ public class TraceSystem implements TraceWriter {
@Override
public boolean isEnabled(int level) {
if (levelMax == ADAPTER) {
return writer.isEnabled(level);
}
return level <= this.levelMax;
}
......
......@@ -32,13 +32,19 @@ public class TestTraceSystem extends TestBase {
testAdapter();
}
private static void testAdapter() {
private void testAdapter() {
TraceSystem ts = new TraceSystem(null);
ts.setName("test");
ts.setLevelFile(TraceSystem.ADAPTER);
ts.getTrace("test").debug("test");
ts.getTrace("test").info("test");
ts.getTrace("test").error(new Exception(), "test");
// The used SLF4J-nop logger has all log levels disabled,
// so this should be reflected in the trace system.
assertFalse(ts.isEnabled(TraceSystem.INFO));
assertFalse(ts.getTrace("test").isInfoEnabled());
ts.close();
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论