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

Don't write all program output to .metals/metals.log #2311

Closed
ckipp01 opened this issue Dec 14, 2020 · 5 comments · Fixed by #3003
Closed

Don't write all program output to .metals/metals.log #2311

ckipp01 opened this issue Dec 14, 2020 · 5 comments · Fixed by #3003
Assignees
Labels
bloop Bloop related tickets debug DAP debug related tickets improvement Not a bug or a feature, but something general we can improve

Comments

@ckipp01
Copy link
Member

ckipp01 commented Dec 14, 2020

I was shocked to find out that my simple project almost without dependencies that just contains solutions for AoC tasks was taking around 500MB of space. Upon closer inspection turns out that there are almost half a gig of logs... I don't know if this is a bug or maybe I'm doing something wrong, so I'm not posting an issue yet, but this can't be right. Should I open an issue?

vijexa@DESKTOP-ETMRL27:~/advent-of-code-2020/advent-of-code-2020/.metals$ du -ahd 1
644K    ./metals.h2.db
488M    ./metals.log
804K    ./readonly
489M    .

Originally posted by @vijexa in #2309

And copying the response from @tgodzik

I think it's due to the fact that Bloop reports it when running, I think we should not write it to log, but I can't remember why it was done in the first place. This should become an issue really.

@tgodzik tgodzik added this to the Metals v1.0.0 milestone Apr 26, 2021
@ckipp01
Copy link
Member Author

ckipp01 commented Jun 14, 2021

I looked into this a bit today and something I noticed was that this is actually Bloop specific. Even though the DAP communication seems to be the same, when using Bloop as a BSP server the output is logged out to INFO, but this doesn't happen when using sbt as a BSP server.

@ckipp01 ckipp01 added bloop Bloop related tickets debug DAP debug related tickets improvement Not a bug or a feature, but something general we can improve labels Jun 14, 2021
@vishalovercome
Copy link

Is the logging configurable? Libraries such as Testcontainers generate a lot of logs and running them as part of worksheets results in disks filling up very quickly. We need a cap on the size of the logs as well as log level configurability.

@tgodzik
Copy link
Contributor

tgodzik commented Jul 20, 2021

We should most likely not log to file at all, I don't think it's useful at any point. We need to fix it in Bloop itself though.

@vishalovercome
Copy link

vishalovercome commented Jul 21, 2021

While metals.log might not be the right place to log program output, we'll need to have some log file, logging configuring capability as that's the only way to debug our worksheets. I would also like to know whether you have a timeline in mind for this fix. Are we going to release it as part of v1.0.0 release?

@tgodzik
Copy link
Contributor

tgodzik commented Jul 21, 2021

Output from a program are normally logged to debug console, so that should be enough. As for worksheets, they should not be logged at all aside from errors, which is a normal Metals logging behaviour.

Timeline will probably be within next couple of months, because I think it's something we need to fix for sure before 1.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bloop Bloop related tickets debug DAP debug related tickets improvement Not a bug or a feature, but something general we can improve
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants