ruby
ruby copied to clipboard
why output "provide either a message or block" if message is nil?
Was tracking down some mystery "DEBUG -- : provide either a message or block" messages in my logs.
Finally found one reference to it, in another issue here for logdna.
It's a terribly unhelpful message, as it gives zero indication of what gem is outputting it... please MENTION your gem name in such messages.
But more to the point, what is wrong with a nil message?
It seems to me that this code:
logger.info
logger.info
logger.info "NOTICE ME!"
logger.info
logger.info
is legitimate and should output 5 INFO lines to the log, 4 without a text message, NOT 4 cryptic "DEBUG" lines saying "provide either a message or block" messages
I'm not sure where in your code it is, but here's your code that IMO ought be removed, or at least mention the source of the message eg the "logdna gem"
if message.nil?
@internal_logger.debug("provide either a message or block")
return
end