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

Rich logging should have a friendlier copy/paste option #4868

Closed
TrustyJAID opened this issue Mar 1, 2021 · 1 comment · Fixed by #5181
Closed

Rich logging should have a friendlier copy/paste option #4868

TrustyJAID opened this issue Mar 1, 2021 · 1 comment · Fixed by #5181
Labels
Help Wanted We'd like help with this. Status: In Progress There's a PR open to deal with this, or an org member is working on this internally Type: Enhancement Something meant to enhance existing Red features.

Comments

@TrustyJAID
Copy link
Member

What component of Red (cog, command, API) would you like to see improvements on?

Rich Logging

Describe the enhancement you're suggesting.

Currently using Rich logging can break copy/pasting useful output for development. Specifically when working with API data I will often log the response, copy it and put it into a json formatter/validator to read easier. Right now rich will put the loggers name on the right half of the terminal including it inside the data I want to copy invalidating any json output and potentially other data formats. Rich also includes extraneous whitespace in the copied output.

@TrustyJAID TrustyJAID added the Type: Enhancement Something meant to enhance existing Red features. label Mar 1, 2021
@github-actions github-actions bot added the Status: Needs Triage This has not been labeled or discussed for handling yet. label Mar 1, 2021
@Jackenmen
Copy link
Member

I made a mock-up of how a more copy-paste friendly logging could look (link to code):

The important parts of this mock-up are:

  • logger name is shown before the log message, which allows the user to not select when copying the log message
  • whitespace from Rich's columns (time and log level) is not present (in 2nd and following lines) when the log message is wrapped
  • automatic hard-wrapping from Rich is disabled so that terminal software handles the wrapping on its own allowing the user to copy-paste the log message without the newlines getting inserted on line wraps

If someone decides to use a different design than the one I proposed here, it is important that these key points are fulfilled by it as well.

@Jackenmen Jackenmen added Category: Bot Core Help Wanted We'd like help with this. Status: Accepted We want this Status: PRs Welcome No one is currently assigned to this issue, but we'd be grateful if anyone made a PR. and removed Status: Needs Triage This has not been labeled or discussed for handling yet. labels Mar 1, 2021
@Jackenmen Jackenmen added this to the 3.4.x milestone Jun 28, 2021
@Jackenmen Jackenmen removed this from the 3.4.x milestone Aug 30, 2021
@Jackenmen Jackenmen added Status: In Progress There's a PR open to deal with this, or an org member is working on this internally and removed Status: Accepted We want this Status: PRs Welcome No one is currently assigned to this issue, but we'd be grateful if anyone made a PR. labels Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted We'd like help with this. Status: In Progress There's a PR open to deal with this, or an org member is working on this internally Type: Enhancement Something meant to enhance existing Red features.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants