差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

Both sides previous revision 前次修改
下次修改 Both sides next revision
java:log4j2:changeloglevelatruntime [2022/02/04 18:27]
tony
java:log4j2:changeloglevelatruntime [2022/02/04 22:01]
tony
行 68: 行 68:
 <code java> <code java>
     @Test     @Test
-    public void Should_NotConsole_When_LogDebugWithDefaultConfiguration() {   +    public void Should_NotSystemOutToConsole_When_LogDebugWithDefaultConfiguration() {   
         TestLogger.debug("​test debug"​);​         TestLogger.debug("​test debug"​);​
         assertEquals(0,​ captor.getStandardOutput().size());​         assertEquals(0,​ captor.getStandardOutput().size());​
行 74: 行 74:
  
     @Test     @Test
-    public void Should_Console_When_LogErrorWithDefaultConfiguration() {+    public void Should_SystemOutToConsole_When_LogErrorWithDefaultConfiguration() {
         TestLogger.error("​test error"​);​         TestLogger.error("​test error"​);​
         assertEquals(1,​ captor.getStandardOutput().size());​         assertEquals(1,​ captor.getStandardOutput().size());​
行 83: 行 83:
 <code java> <code java>
     @Test     @Test
-    public void Should_Console_When_LogDebugAfterChangingLogLevelWithConfigurator() {+    public void Should_SystemOutToConsole_When_LogDebugAfterChangingLogLevelWithConfigurator() {
         Configurator.setLevel(TestLogger.class.getName(),​ Level.DEBUG);​         Configurator.setLevel(TestLogger.class.getName(),​ Level.DEBUG);​
         ​         ​
行 94: 行 94:
 <code java> <code java>
     @Test     @Test
-    public void Should_Console_When_LogDebugAfterChangingLogLevel() {+    public void Should_SystemOutToConsole_When_LogDebugAfterChangingLogLevel() {
         LoggerContext ctx = (LoggerContext) LogManager.getContext(false);​         LoggerContext ctx = (LoggerContext) LogManager.getContext(false);​
         Configuration config = ctx.getConfiguration();​         Configuration config = ctx.getConfiguration();​