dd-trace-rb icon indicating copy to clipboard operation
dd-trace-rb copied to clipboard

Add debug info for log device

Open TonyCTHsu opened this issue 1 year ago • 2 comments

What does this PR do?

Adding debug info for Logger::LogDevice

Motivation:

We have seen this flaky specs in CircleCI, especially with JRuby.

log writing failed. closed stream

The error cannot be reproduce locally but it seems to be pretty generic when trying to write to a closed stream.

logger = Logger.new('t.log')
logger.close       # => nil
logger.info('foo') # Prints "log writing failed. closed stream"

Source: https://github.com/ruby/ruby/blob/master/lib/logger/log_device.rb#L48

TonyCTHsu avatar Jun 10 '24 14:06 TonyCTHsu

Also, you may want to check that the monkey patch works by e.g. creating a logger on a new stream (such as StringIO) and then closing it, and then checking we get all the relevant info :)

ivoanjo avatar Jun 10 '24 15:06 ivoanjo

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.11%. Comparing base (d673469) to head (163f5c7). Report is 22 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3699   +/-   ##
=======================================
  Coverage   98.11%   98.11%           
=======================================
  Files        1225     1225           
  Lines       72743    72743           
  Branches     3479     3479           
=======================================
  Hits        71371    71371           
  Misses       1372     1372           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jun 10 '24 16:06 codecov-commenter