Provides a typhonjs-core-logging enabled version of typhonjs-core-backbone-events. Please refer to typhonjs-core-backbone-events documentation for usage details.
TyphonLoggedEvents adds new functionality for triggering events. The following are new trigger mechanisms:
triggerDefer
- Defers invokingtrigger
.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 throughPromise.all
which 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 thelogData
object 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.