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

Add some color to the relevant filenames in terminal log #5345

Merged
merged 1 commit into from
Oct 24, 2018

Conversation

bep
Copy link
Member

@bep bep commented Oct 24, 2018

Fixes #5344

@bep
Copy link
Member Author

bep commented Oct 24, 2018

image

@bep
Copy link
Member Author

bep commented Oct 24, 2018

Unfortunately these escape codes currently also creeps into the log file (if enabled):

WARN 2018/10/24 11:35:22 Content dir "/Users/bep/sites/hugotest/content_s/s1" already processed; skipped to avoid infinite recursion.
ERROR 2018/10/24 11:35:22 ESC[1;36m"/Users/bep/sites/hugotest/layouts/_default/baseof.html:16:75"ESC[0m: execute of template failed: template: _default/list.html:16:75: executing "_default/list.html" at <.Sites.Title>: can't evaluate field Title in type hugolib.SiteInfos
ERROR 2018/10/24 11:35:22 ESC[1;36m"/Users/bep/sites/hugotest/layouts/_default/baseof.html:16:75"ESC[0m: execute of template failed: template: _default/list.html:16:75: executing "_default/list.html" at <.Sites.Title>: can't evaluate field Title in type hugolib.SiteInfos
ERROR 2018/10/24 11:35:22 ESC[1;36m"/Users/bep/sites/hugotest/layouts/_default/baseof.html:16:75"ESC[0m: execute of template failed: template: _default/list.html:16:75: executing "_default/list.html" at <.Sites.Title>: can't evaluate field Title in type hugolib.SiteInfos
ERROR 2018/10/24 11:35:22 ESC[1;36m"/Users/bep/sites/hugotest/layouts/_default/baseof.html:16:75"ESC[0m: execute of template failed: template: _default/single.html:16:75: executing "_default/single.html" at <.Sites.Title>: can't evaluate field Title in type hugolib.SiteInfos

I guess we can live with that, but it would be cool if we could avoid it ...

@bep bep force-pushed the colors-terminal branch from c6765cf to d48a531 Compare October 24, 2018 10:02
@bep
Copy link
Member Author

bep commented Oct 24, 2018

OK, I have added a "ansi cleaner" to the log handler that should do the trick for my last comment.

@bep bep requested a review from kaushalmodi October 24, 2018 10:18
@kaushalmodi
Copy link
Contributor

I haven't built with this PR yet. But looking at the screenshot, it looks like the reds and yellows are missing for errors and warnings.

Like the blue Notice method, can you add red (white text in red background) and yellow (yellow text in default background) variants to wrap the "ERROR" and "WARN" strings?

@kaushalmodi
Copy link
Contributor

Nevermind, I got confused with #4414.

@bep
Copy link
Member Author

bep commented Oct 24, 2018

Nevermind, I got confused with #4414.

Yes, as I pointed out in that thread, that one need some more investigation.

@bep
Copy link
Member Author

bep commented Oct 24, 2018

I'll merge this now ... I people disagree about the color, we can put it up for a vote or something. I like this.

@bep bep merged commit deff9e1 into gohugoio:master Oct 24, 2018
@github-actions
Copy link

github-actions bot commented Feb 1, 2022

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add some color to the relevant filename in terminal
2 participants