Skip to content

Additional logging of the scala/java/scala-cli versions #3598

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
yadavan88 opened this issue Mar 31, 2025 · 4 comments
Open

Additional logging of the scala/java/scala-cli versions #3598

yadavan88 opened this issue Mar 31, 2025 · 4 comments
Labels
enhancement New feature or request logging Items related to logs & verbosity spree UX

Comments

@yadavan88
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When a scala-cli project is compiled for the first time(or recompiled after change), it shows the scala version and the jdk version. If there is no change in the code, on the next runs, it doesn't log this info.
Furthermore, this doesn't show the scala-cli version in the log.
Attaching the screenshot of the output I get when I run a file

Image

Describe the solution you'd like
It would be nice if there is an option or a directive or something like it that could show these info all the time(since the default behaviour is not to have too many logs and lose focus for most people). When working with multiple JDKs and Scala Versions, it would be beneficial to always see which scala and jdk is used to run the program just as a reminder. Also, unless someone remembers to update the scala-cli version, one might use the older version of scala-cli without realizing. For example, I was using 1.5.x in one of my laptops when the current version is 1.7.x. Seeing an info about the versions used might give an hint to check if these are the expected/intereted versions.

Describe alternatives you've considered
Clean compile and manually checking the scal-cli version once in a while

Additional context
In discord, the suggestion is to have less logs as the preferred method, but an option to have additional important logs might be nice.

@yadavan88 yadavan88 added the enhancement New feature or request label Mar 31, 2025
@Gedochao
Copy link
Contributor

What I think we could do:

  • at increased verbosity (behing a single -v flag), log Scala / JVM versions even when no re-compilation happens
    • we currently only do it with Bloop; we probably could also log the information with --server=false
  • we could have a dedicated verbosity flag (--log-cli-version?) and/or global config (log-cli-version) for logging the CLI version as well (or, alternatively, also do it at increased verbosity, perhaps at -v -v)

@Gedochao Gedochao added logging Items related to logs & verbosity UX spree labels Mar 31, 2025
@yadavan88
Copy link
Contributor Author

yadavan88 commented Mar 31, 2025

Is this verbocity flag be added as a directive? I mean in some of my scripts, I want to ensure that this info is always logged. I prefer to keep all as directives in the file (even commented out, so that i can enable it later if needed and don't need to remember the flags or search in internet to find out)

@Gedochao
Copy link
Contributor

Is this verbocity flag be added as a directive? I mean in some of my scripts, I want to ensure that this info is always logged.

As a rule, verbosity can't (and shouldn't) be configured by directives.

@yadavan88 In that case, for your use case, perhaps you'd like to print the information you need yourself and control it in the script.
Then it doesn't have to be controlled by verbosity (which many want to keep at a minimum).
You can use BuildInfo to get the build data you need, as per https://scala-cli.virtuslab.org/docs/reference/build-info

I think the CLI version is missing from the BuildInfo object. If that would fit your use case, feel free to raise an issue for that, separately.

@yadavan88
Copy link
Contributor Author

Sure, reg the full verbocity, I will try to add it using buildInfo.
I guess scala-cli version and scala/java is still be nice to be added as part of -v

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request logging Items related to logs & verbosity spree UX
Projects
None yet
Development

No branches or pull requests

2 participants