TyphonLoggedEvents adds new functionality for triggering events. The following are new trigger mechanisms:
triggerDefer- Defers invoking
triggerFirst- Only invokes the first target matched and passes back any result to the callee.
triggerResults- Invokes all targets matched and passes back an array of results in an array to the callee.
triggerThen- Invokes all targets matched and adds any returned results through
Promise.allwhich returns a single promise to the callee.
mainEventbus.js provides a standardized instance of TyphonLoggedEvents which serves as the name implies as a main eventbus.
Enabling eventbus logging aids debugging. A notable addition to the API is the following methods:
setEventScrubber- Sets a function which should accept one parameter which processes the
logDataobject hash which is about to be sent to the logger. This is useful for scrubbing sensitive data such as username / password.
setLogLevel- Sets the log level used for logging output.