Package com.carfey.ops.event.dispatch
Class StandardOutputStreamsEventHook
- java.lang.Object
-
- com.carfey.ops.event.dispatch.StandardOutputStreamsEventHook
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONFIG_KEYstatic java.util.Set<Category>DEFAULT_CATEGORIESstatic java.util.Set<Level>DEFAULT_LEVELS
-
Constructor Summary
Constructors Constructor Description StandardOutputStreamsEventHook(java.util.Set<Level> levels, java.util.Set<Category> categories)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispatch(Event event)This method is invoked for each event, regardless of level or category.booleanequals(java.lang.Object obj)java.util.Set<Category>getCategories()java.util.Set<Level>getLevels()inthashCode()protected voidpost(Event event)Override to change the actual outputprotected booleanshouldPostEvent(Event event)Override to get custom behaviour on whether to write events to standard output streamsjava.lang.StringtoString()
-
-
-
Field Detail
-
CONFIG_KEY
public static final java.lang.String CONFIG_KEY
- See Also:
- Constant Field Values
-
DEFAULT_LEVELS
public static final java.util.Set<Level> DEFAULT_LEVELS
-
DEFAULT_CATEGORIES
public static final java.util.Set<Category> DEFAULT_CATEGORIES
-
-
Method Detail
-
dispatch
public void dispatch(Event event) throws java.lang.Exception
Description copied from interface:EventHook
-
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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-