Class StacklessLogging

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class StacklessLogging
    extends java.lang.Object
    implements java.lang.AutoCloseable
    A try-with-resources compatible layer for hiding stacktraces within the scope of the try block when logging with StdErrLog implementation.

    Use of other logging implementation cause no effect when using this class

    Example:

     try (StacklessLogging scope = new StacklessLogging(EventDriver.class,Noisy.class))
     {
         doActionThatCausesStackTraces();
     }
     
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      • Methods inherited from class java.lang.Object

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

      • StacklessLogging

        public StacklessLogging​(java.lang.Class<?>... classesToSquelch)
      • StacklessLogging

        public StacklessLogging​(Logger... logs)
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable