Skip to content

Added colorful outputs to the log files #40

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

james-may-hammond
Copy link

Here are the changes I've made

  • Uses the colored crate for ANSI color codes.
  • A bright red for errors
  • A blue for info
    [* Colored outputs are not supported everywhere, I have tested using the "less -R" command]

@CodeF0x
Copy link
Owner

CodeF0x commented Jul 23, 2025

Hi @james-may-hammond, thanks for the contribution! I will have a closer look in the coming days, currently I'm a little swamped. I hope you understand.

@CodeF0x
Copy link
Owner

CodeF0x commented Aug 5, 2025

Hi, wanted to give you an update: I'm close to merging a big MR I've been cooking up. Because it's a major refactor, your MR will probably have merge conflicts. I can resolve them for you if you want since I'm the cause of the conflicts.

After #37 is merged, I will have a closer look at your changes.

@james-may-hammond
Copy link
Author

My changes are rather simple once you're done with the MR I can implement them again and create a pr.

Copy link
Owner

@CodeF0x CodeF0x left a comment

Choose a reason for hiding this comment

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

I allowed myself to rebase your branch and adjust your changes to the new project structure. I noted a small thing, otherwise lgtm!


self.write_to_log(&line);
let red_line = line.bright_red().to_string();
self.write_to_log(&red_line);
Copy link
Owner

Choose a reason for hiding this comment

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

It's probably preferable to leave the log in plain text. Otherwise the log is full of color codes, e.g. �[0m�[91m[ERROR in THREAD 0...

Copy link
Author

Choose a reason for hiding this comment

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

Wasn't the issue to add colorful ops to the log files?

Copy link
Owner

Choose a reason for hiding this comment

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

You're right. I didn't think that could become a problem if one tries to process the logs programmatically and it's not very pleasing to the eyes.

So my proposal is to just show colors in the terminal output when --verbose is set and keep the log file in plain text.

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