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

introduce verbosity levels #1175

Open
hasufell opened this issue Dec 15, 2024 · 3 comments
Open

introduce verbosity levels #1175

hasufell opened this issue Dec 15, 2024 · 3 comments
Assignees

Comments

@hasufell
Copy link
Member

We want verbosity for e.g. CI where:

  • we don't see all the noisy debug output
  • but we also don't have the wrapped screen output and no colors
@hasufell hasufell added this to the 0.1.40.0 milestone Dec 15, 2024
@dfordivam dfordivam self-assigned this Dec 27, 2024
@dfordivam
Copy link
Collaborator

If I understand correctly, we would like to see debug messages from ghcup, like these

[ Debug ] Decoding yaml at: /home/divam/.ghcup/cache/ghcup-0.0.8.yaml
[ Debug ] Running sh with arguments ["./configure","--prefix=/home/divam/.ghcup/ghc/9.6.6"]
[ Debug ] Running gmake with arguments ["DESTDIR=/home/divam/.ghcup/tmp/ghcup-82ee81a4336f1b13","install"]

without all the noisy output from ./configure and make. The output from these should be shown the same way it is shown without -v

@ulidtko
Copy link

ulidtko commented Dec 27, 2024

FWIW, Github Actions CI does support console colors. (The classic escape sequences). Here's a quick sample:

image

But because GHA runner doesn't create a PTY (neither forwards it properly through all the containers) — the isatty(stdout) call returns false — thus virtually all classic tooling autodetects color support as absent — so it never works by default.

Must force-enable it explicitly, e.g. for stack call it with --color always.

@hasufell hasufell removed this from the 0.1.40.0 milestone Dec 30, 2024
@dfordivam
Copy link
Collaborator

These are the stats for the log generated by install ghc

Total lines: 16.5k
configure: 740
make: 430
merge tree log: 15.3k ("Recording installed file: ")

We can reduce a big amount of noise by removing merge tree logs from the default verbose output, and that would improve the situation a lot.

But there is another solution for GitHub as it has a way to group the log lines together and collapse them, so that viewing the file on the web will be much more easier.

Image

To achieve this we need to wrap the log lines with these start/end "tags"

##[group][ Debug ] Log group header
...
...
##[endgroup]

One issue with this approach could be if there is interleaving of log lines from multiple places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants