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

Show verbose output with -v and --verbose #502

Open
milancurcic opened this issue Jun 23, 2021 · 6 comments
Open

Show verbose output with -v and --verbose #502

milancurcic opened this issue Jun 23, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@milancurcic
Copy link
Member

I think initially proposed here.

Currently fpm prints compiler commands that it executes to the standard output, which is quite verbose. I don't think there's a way to disable it.

Such output should be enabled with -v or --verbose flags, and by default only print a concise and pretty status like a progress bar. A progress bar is for a separate issue, but in the meantime fpm could just print something like:

Compiling src/some_module.f90...
Compiling src/another_module.f90...
...

or similar.

@milancurcic milancurcic added the enhancement New feature or request label Jun 23, 2021
@urbanjost
Copy link
Contributor

Before reformatting to much, take a look at #PR504 or there is a single-file version (temporarily) at
bootstrap. Feedback on if that looks better appreciated.

@urbanjost
Copy link
Contributor

@milancurcic, @certik -- is that in the direction of what you had in mind? Does anyone know if there are any Programming Environments that use terminal emulators that do not obey ANSI in-line escape sequences? I made color the default when output it to a TTY.

@certik
Copy link
Member

certik commented Jun 29, 2021

I tested it and it looks like this for me:

Screen Shot 2021-06-29 at 5 32 27 PM

So you can see the different colors and it hides the compilation line. Yes, that is exactly what I had in mind. I tested it on the fpm sources themselves, which produce a lot of warnings for me (we should fix those --- separate issue).

Thank you!

@urbanjost
Copy link
Contributor

urbanjost commented Jun 30, 2021

I made the default help for a plain "fpm" or "fpm --list" command more colorful for a nice first impression; and trivially colorized the general help text. A context colorizer routine would be nice. If you do "fpm build --profile release" it is a lot less verbose to see how it "should" look. There are a lot of bugzilla entries about the excessive amount of messages; and some are pretty old, so it might be a while before that goes away. So many messages it is easy to miss the important ones, but like you said "separate issue". It gets messy pretty quickly without a context colorizer so do not plan on coloring anything else that much but it came out OK.

snap

@ghost
Copy link

ghost commented Jul 3, 2021

Idea: if a command fails, fpm could display the last command line that failed, so that users would not need to run fpm again, with --verbose.

@urbanjost
Copy link
Contributor

Per a discussion with @LKedward I think the idea is that the compile, load, and archive commands will write to a log file. Then the log file for the last command can be displayed on failure, and some way to redisplay all the messages, hopefully some way to display the logs for specified source files, and that opens up the possibility that plugin tools could post-process the logs, and maybe allow invoking an edtor and jumping to a line, etc. I think that would incorporate your suggestion; maybe needs a more formal spec but I think all the ideas will come together nicely. Of course, if gfortran did not spit out so messages this would not be so highly desirable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants