Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: Copy button for messages #106

Merged
merged 3 commits into from Jan 16, 2020
Merged

FEATURE: Copy button for messages #106

merged 3 commits into from Jan 16, 2020

Conversation

OsamaSayegh
Copy link
Member

This PR introduces a new button that copies enough details about the message to debug/fix it. This is useful if you want a quick way to share a message with your team.

Currently the button copies 3 things:

  1. the log message
  2. the first 10 lines of the backtrace
  3. all HTTP_HOST from env

Should we copy anything else from env @SamSaffron?

Screenshot:

image

There is also a small improvement to backtraces in this PR: currently when you log a message in your app code (for exmaple: Rails.logger.warn("blah blah"), you'll notice the first few frames in the backtrace are Logster's own method calls. This PR should stop that and from now on the first frame in the backtrace should be the method where you logged the message in your app.

@@ -70,6 +70,18 @@ def add_with_opts(severity, message = nil, progname = progname(), opts = nil, &b
message = message.scrub
end

# we want to get the backtrace as early as possible so that logster's
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh nice change!

@SamSaffron
Copy link
Member

looks good to me!

@OsamaSayegh OsamaSayegh merged commit d0d967f into discourse:master Jan 16, 2020
@OsamaSayegh OsamaSayegh deleted the handy-copy-button branch January 16, 2020 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants