Class StandardOutputStreamsEventHook

  • All Implemented Interfaces:
    EventHook

    public class StandardOutputStreamsEventHook
    extends java.lang.Object
    implements EventHook
    • Field Detail

      • DEFAULT_LEVELS

        public static final java.util.Set<Level> DEFAULT_LEVELS
      • DEFAULT_CATEGORIES

        public static final java.util.Set<Category> DEFAULT_CATEGORIES
    • Constructor Detail

      • StandardOutputStreamsEventHook

        public StandardOutputStreamsEventHook​(java.util.Set<Level> levels,
                                              java.util.Set<Category> categories)
    • Method Detail

      • dispatch

        public void dispatch​(Event event)
                      throws java.lang.Exception
        Description copied from interface: EventHook
        This method is invoked for each event, regardless of level or category. Implementors must handle filtering which events require processing depending on the Level and Category.
        Specified by:
        dispatch in interface EventHook
        Throws:
        java.lang.Exception
      • post

        protected void post​(Event event)
                     throws java.lang.Exception
        Override to change the actual output
        Throws:
        java.lang.Exception
      • shouldPostEvent

        protected boolean shouldPostEvent​(Event event)
        Override to get custom behaviour on whether to write events to standard output streams
        Returns:
        true if this event should be written
      • getLevels

        public java.util.Set<Level> getLevels()
      • getCategories

        public java.util.Set<Category> getCategories()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object