org.wso2.carbon.identity.testutil.log

Class NullAppender

  • java.lang.Object
    • org.apache.log4j.AppenderSkeleton
      • org.wso2.carbon.identity.testutil.log.NullAppender
  • All Implemented Interfaces:
    org.apache.log4j.Appender, org.apache.log4j.spi.OptionHandler

    public class NullAppender
    extends org.apache.log4j.AppenderSkeleton
    Log4J Log Appender, which does nothing. Logs simply goes into a black hole. This is primarily used to skip DEBUG and INFO logs being printed by testNg unit tests. We create multiple unit test(s) and suite(s) for each DEBUG and INFO log levels to get the proper coverage. Printing all the logs into the console clutters the console, makes the test execution slow and causes OOM. Null Appender helps to prevent the above problems.
    • Field Summary

      • Fields inherited from class org.apache.log4j.AppenderSkeleton

        closed, errorHandler, headFilter, layout, name, tailFilter, threshold
    • Constructor Summary

      Constructors  
      Constructor and Description
      NullAppender() 
    • Method Summary

      All Methods  Instance Methods  Concrete Methods 
      Modifier and Type Method and Description
      protected void append(org.apache.log4j.spi.LoggingEvent loggingEvent) 
      void close() 
      boolean requiresLayout() 
      • Methods inherited from class org.apache.log4j.AppenderSkeleton

        activateOptions, addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold
    • Constructor Detail

      • NullAppender

        public NullAppender()
    • Method Detail

      • append

        protected void append(org.apache.log4j.spi.LoggingEvent loggingEvent)
        Specified by:
        append in class  org.apache.log4j.AppenderSkeleton
      • close

        public void close()
      • requiresLayout

        public boolean requiresLayout()

Copyright © 2018 WSO2. All rights reserved.