Re:An event bus framework for event driven programming
by zer0gravity on Monday July 25, 2016 @02:03PM
(#12160387)
Well, to be really fair compare it with :
And yeah, it requires a bit more typting if you want to enforce a certain event format and want to add more parameters. But you only do that once, and I'd say you gain much more for your effort.
[ Parent
| on HN ]
Re:An event bus framework for event driven programming
by CHY872 on Monday July 25, 2016 @06:27PM
(#12162075)
Fyi, intended usage with most Java loggers is to just call
logger.debug("...");
and ignore the conditional. If `!logger.isDebugEnabled` then the logger will ignore the message, so it avoids boilerplate.
Re:An event bus framework for event driven programming
by zer0gravity on Tuesday July 26, 2016 @12:53AM
(#12163409)
You want to wrap it in an if in order to avoid doing extra work ( like string concatenation or whatever ) and save some computation. It's to improve performance when logging is not enabled.
Re:An event bus framework for event driven programming
by jestar_jokin on Tuesday July 26, 2016 @12:57AM
(#12163422)
No good if you're computing the message somehow. e.g.
logger.debug(generateSomethingLarge());