Class LogLevelAdjuster

java.lang.Object
org.springframework.amqp.rabbit.junit.LogLevelAdjuster
All Implemented Interfaces:
org.junit.rules.MethodRule

@Deprecated(since="4.0", forRemoval=true) public class LogLevelAdjuster extends Object implements org.junit.rules.MethodRule
Deprecated, for removal: This API element is subject to removal in a future version.
since 4.0 in favor of JUnit 5 LogLevels.
A JUnit method @Rule that changes the logger level for a set of classes while a test method is running. Useful for performance or scalability tests where we don't want to generate a large log in a tight inner loop.

As well as adjusting Log4j, this also adjusts loggers for logback. The amqp-client library now uses Slf4J. Since we have logback on the CP (for the appender) we can't add the slf4j-log4j bridge as well.

Author:
Dave Syer, Artem Bilan, Gary Russell
  • Constructor Summary

    Constructors
    Constructor
    Description
    LogLevelAdjuster(org.apache.logging.log4j.Level level, Class<?>... classes)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.junit.runners.model.Statement
    apply(org.junit.runners.model.Statement base, org.junit.runners.model.FrameworkMethod method, Object target)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    categories(String... categoriesToAdjust)
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LogLevelAdjuster

      public LogLevelAdjuster(org.apache.logging.log4j.Level level, Class<?>... classes)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • categories

      public LogLevelAdjuster categories(String... categoriesToAdjust)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • apply

      public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runners.model.FrameworkMethod method, Object target)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      apply in interface org.junit.rules.MethodRule