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

Remove noise from logs #227

Closed
olafurpg opened this issue Apr 2, 2018 · 5 comments
Closed

Remove noise from logs #227

olafurpg opened this issue Apr 2, 2018 · 5 comments

Comments

@olafurpg
Copy link
Member

olafurpg commented Apr 2, 2018

.metals/metals.log emits a lot of noisy logs

18:41:24.968 INFO  s.m.m.s.InMemorySymbolIndex - resolveName at Uri(file:///Users/ollie/dev/metals/test-workspace/src/main/scala/example/User.scala):9:16
18:41:24.968 INFO  s.m.m.s.InMemorySymbolIndex - Found document for Uri(file:///Users/ollie/dev/metals/test-workspace/src/main/scala/example/User.scala)
18:41:24.969 INFO  s.m.m.s.InMemorySymbolIndex - Matching symbol _root_.java.lang.String#length()I.
18:41:25.218 INFO  s.m.m.s.InMemorySymbolIndex - resolveName at Uri(file:///Users/ollie/dev/metals/test-workspace/src/main/scala/example/User.scala):9:18
18:41:25.219 INFO  s.m.m.s.InMemorySymbolIndex - Found document for Uri(file:///Users/ollie/dev/metals/test-workspace/src/main/scala/example/User.scala)
18:41:25.220 INFO  s.m.m.s.InMemorySymbolIndex - Matching symbol _root_.java.lang.String#length()I.
18:41:25.794 INFO  s.m.m.s.InMemorySymbolIndex - resolveName at Uri(file:///Users/ollie/dev/metals/test-workspace/src/main/scala/example/User.scala):9:18
18:41:25.794 INFO  s.m.m.s.InMemorySymbolIndex - Found document for Uri(file:///Users/ollie/dev/metals/test-workspace/src/main/scala/example/User.scala)
18:41:25.795 INFO  s.m.m.s.InMemorySymbolIndex - Matching symbol _root_.java.lang.String#length()I.

We should clean up the logs so that they are easier to read. I'm wondering if we can figure out a way to override the default log level so that we can get extra verbose output when debugging. Any ideas?

@gabro
Copy link
Member

gabro commented Apr 2, 2018

I think that's doable by passing a loglevel as an option to the server and configuring the vscode launcher to pass the option when launched in debug mode.

@laughedelic
Copy link
Member

By the way, from the LSP point of view all messages are logged with the "debug" level:

https://github.com/laughedelic/metals/blob/6f55b052ee51624fcc18e495db5de31d6de6d214/lsp4s/src/main/scala/org/langmeta/lsp/Endpoints.scala#L79-L81

I think they should use info/warn/error/log levels. In Atom they currently all look the same:

screen shot 2018-03-16 at 04 31 44

But sbt messages look different, because they set this level properly (except for those "Done"/"Processing", which are a whole different story):
screen shot 2018-03-26 at 23 48 51

@olafurpg
Copy link
Member Author

#328 takes steps towards at least improving the formatting of log messages

screen shot 2018-09-27 at 18 11 44

  • It would be good to define a process for deciding what messages are reported at what level.
  • wdyt about configuring the minimum debug level according to a configuration option? The new scribe logging makes it easy to dynamically update the minimum logging level.

@gabro
Copy link
Member

gabro commented Sep 28, 2018

wdyt about configuring the minimum debug level according to a configuration option?

big +1 on this, it would also be useful for the vscode client, which has different run configurations (debug/"prod") already.

@olafurpg
Copy link
Member Author

All log entries have been removed in #292, we can restart this discussion in case the new implementation emits noisy logs. I will do my best to keep the noise down

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

3 participants