Skip to content

Colorize entry action in logs#2541

Merged
liiight merged 8 commits intodevelopfrom
color_by_action
Jan 1, 2020
Merged

Colorize entry action in logs#2541
liiight merged 8 commits intodevelopfrom
color_by_action

Conversation

@liiight
Copy link
Copy Markdown
Member

@liiight liiight commented Dec 23, 2019

Motivation for changes:

It'd be nice to have some distinction in logs between accept/reject.

Detailed changes:

  • Colorized entry action in log

To Do:

@gazpachoking
Copy link
Copy Markdown
Member

I re-implemented the verbose method as discussed in Delgan/loguru#192, so this should work properly now.

@liiight
Copy link
Copy Markdown
Member Author

liiight commented Dec 27, 2019

I'll verify and merge

@liiight
Copy link
Copy Markdown
Member Author

liiight commented Dec 27, 2019

I ran autoformat and it formatted a lot of unrelated stuff... I think we should integrate pre-commit soon

Copy link
Copy Markdown
Member

@gazpachoking gazpachoking left a comment

Choose a reason for hiding this comment

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

I'd avoid mixing in all the unrelated format changes into PRs in the future. makes it way harder to review the actual changes. Not too sure about the whole entry state enum, but not really against it either. We should perhaps move to using it in more places if it stays in.

@gazpachoking
Copy link
Copy Markdown
Member

gazpachoking commented Dec 27, 2019

I ran autoformat and it formatted a lot of unrelated stuff... I think we should integrate pre-commit soon

Agreed on pre-commit, although I tried it on my work (windows) machine and it was not easy to get set up here. If I remember correctly, it went smoothly on my home windows machine, I'll add the pre-commit script when I get there and can test it properly. Also, maybe we should modify the autoformat dev tool to only run on files changed in the git working tree by default, and require some extra param to do everything.

@liiight
Copy link
Copy Markdown
Member Author

liiight commented Dec 27, 2019

Yeah, I should have probably skipped yhecautoformats stuff but I saw that it didnt render the changes completely unreadable.
I definitely agree that we should use this and a lot more enums in our codebase. Enums are one of the nicest features that python3 introduced IMO, and we should definitely work them in

…Flexget/Flexget into color_by_action

� Conflicts:
�	flexget/components/tmdb/tmdb_lookup.py
�	flexget/components/trakt/trakt_calendar.py
@gazpachoking
Copy link
Copy Markdown
Member

@liiight I like that simple escaping solution. We can figure out a better way if we start coloring more stuff and need to.

@liiight
Copy link
Copy Markdown
Member Author

liiight commented Jan 1, 2020

I agree. This was a bit trickier since we generically markup messages. I imagine that if we'd want to use this in a more specific use case it won't be an issue

@liiight liiight merged commit dd72fe8 into develop Jan 1, 2020
@liiight liiight deleted the color_by_action branch January 1, 2020 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants