logdna / logdna/ruby

why output "provide either a message or block" if message is nil?

Open
#43 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
19
Forks
18
PR merge metrics
No merged PRs in 30d

Description

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
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the repository for the exact message "provide either a message or block" and inspect the logger.info path handling a nil message. The issue does not name a file or test; done requires an agreed behavior for nil messages and a diagnostic that identifies the gem if the call remains invalid.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
observability-sre
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.