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

Syntax highlighting in the build/deploy logs #79

Open
seanhamlin opened this issue Nov 27, 2022 · 1 comment
Open

Syntax highlighting in the build/deploy logs #79

seanhamlin opened this issue Nov 27, 2022 · 1 comment

Comments

@seanhamlin
Copy link

At present, all the logs are just emitted out, with no interpretation of ANSI codes. This can make finding things like errors more difficult, and in general just makes the logs harder to read.

Current workaround

You can remove ANSI codes with most tooling, e.g. composer has composer --no-ansi, this strips the ANSI codes prior to printing. No colour however.

Proposal

Render the default ANSI colours into HTML so that they are viewable in the UI of Lagoon

here is an example of the ANSI codes being emitted, but not rendered:

$ NODE_ENV=production webpack --mode production --progress
�[91m<s> [webpack.Progress] 0% 
�[0m�[91m
�[0m�[91m<s> [webpack.Progress] 1% setup before run
�[0m�[91m<s> [webpack.Progress] 1% setup before run NodeEnvironmentPlugin
�[0m�[91m<s> [webpack.Progress] 1% setup before run
�[0m�[91m<s> [webpack.Progress] 2% setup run
�[0m�[91m<s> [webpack.Progress] 2% setup run webpack-cli
�[0m�[91m<s> [webpack.Progress] 2% setup run WebpackManifestPlugin
�[0m�[91m<s> [webpack.Progress] 2% setup run
�[0m�[91m<s> [webpack.Progress] 4% setup normal module factory

An example with colour

image

Perhaps something like https://www.npmjs.com/package/ansi-to-html could be used?

@tobybellwood tobybellwood transferred this issue from uselagoon/lagoon Nov 27, 2022
@bomoko
Copy link
Contributor

bomoko commented Nov 27, 2022

we could probably use something like https://www.npmjs.com/package/ansi-to-react

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

No branches or pull requests

2 participants