In the following Ruby code, should logger default to `$stderr` or `$stdout`?

logger =

CSV do |csv| "Generating row..."
csv << ['1', '2', '3']

Please reply with your reasoning.

@ioquatix @postmodern yes but I’m speaking fir long running daemons, not Unix style scripts.

@mperham @postmodern Why does it make any difference for long running daemons vs scripts? Is there some downside to putting all logging/diagnostics to `stderr`? In contrast, since `stdout` is buffered, there are downsides to using it for logging, e.g. missing output on crash.

Sign in to participate in the conversation

A Mastodon instance for Rubyists & friends