lograge icon indicating copy to clipboard operation
lograge copied to clipboard

Add halted_callback to the log output

Open benoittgt opened this issue 7 years ago • 5 comments
trafficstars

Fix https://github.com/roidrage/lograge/issues/258

Sometimes when you do the final render or redirection, it can be halted by a controller callback. With the existing code, it can very hard to understand where it stopped.

With this commit, the intent is to provide the method name where it stops.

I have only one rubocop offense:

lib/lograge/log_subscriber.rb:8:3: C: Class has too many lines. [102/100]
  class RequestLogSubscriber < ActiveSupport::LogSubscriber ...
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

32 files inspected, 1 offense detected
RuboCop failed!

What could I do? Extract all logic of extract_runtimes, extract_location, extract_unpermitted_paramsandextract_halted_callbackinto separateclass`?

benoittgt avatar Sep 10 '18 14:09 benoittgt

We are using this on production since the PR without any issue.

benoittgt avatar Nov 28 '18 14:11 benoittgt

@benoittgt could you rebase on master so CI runs?

iloveitaly avatar Jan 24 '22 18:01 iloveitaly

@benoittgt would be great if you could rebase on master if you have time, thank you!

Sorry, actually I ended up doing it myself here https://github.com/roidrage/lograge/pull/373

For now it won't work for every case so need to figure this out first, and merging this PR is not yet possible

jeremybdk avatar Sep 12 '23 09:09 jeremybdk

@jeremybdk could you submit a new PR which doesn't have a master conflict?

iloveitaly avatar Oct 14 '23 15:10 iloveitaly

This should do it. https://github.com/roidrage/lograge/pull/375

benoittgt avatar Oct 24 '23 13:10 benoittgt