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: Linkify backtrace lines to github #104

Merged
merged 9 commits into from Jan 3, 2020
Merged

FEATURE: Linkify backtrace lines to github #104

merged 9 commits into from Jan 3, 2020

Conversation

OsamaSayegh
Copy link
Member

This PR adds a new feature that allows Logster to make each backtrace line link to the correct file and line on Github. This PR also truncates backtrace lines from gems to reduce noise (you can click on ... next to each line to expand).

The way this works is you need to provide Logster with an array of hashes where each hash represents a directory/repository path on the file system and a Github link of the repository.

For example if you're using Logster with a Rails app, your Logster configuration for this feature may look like this:

Logster.config.project_directories = [
  { path: Rails.root.to_s, url: "https://github.com/<your_org>/<your_repo>" }
]

Additionally, you can add a main_app: true key to the hash to indicate that Logster should use the current value of the application_version config when generating Github links. That way the Github links will point to the exact version of your app when the error occurred. If this key is not given in the hash, Logster will use the master branch.

Screenshot:

image

@SamSaffron
Copy link
Member

Can we make the link a bit more subtle? maybe a simple icon?

Also I wonder if we should also allow for a very simple local file viewer? Then you can click on any file at all and show it if it is available on local?

@OsamaSayegh
Copy link
Member Author

OsamaSayegh commented Jan 2, 2020

Are you thinking something like this?

image

Or maybe put the icon to the left?

image

Or perhaps we could make the link color the same as everything else and just keep the underlining?

image

Yeah I think it makes sense to have local file viewer as a fallback option that can be turned on or off. If we can't figure out the Github link, we fallback to showing the file locally if it's turned on.

@SamSaffron
Copy link
Member

I like the link to the right, also maybe the ... is just too much noise and we skip it?

@OsamaSayegh
Copy link
Member Author

Ok, here is how it looks now:

image

If this looks good now, I'd like to merge this and make a separate PR for local file viewer. Does this sound good?

@SamSaffron
Copy link
Member

Looks good to me now! Yeah lets try this out!

@OsamaSayegh OsamaSayegh merged commit 294e13f into discourse:master Jan 3, 2020
@OsamaSayegh OsamaSayegh deleted the backtrack-links branch January 3, 2020 05:15
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