Metals: Remove noise from logs

Created on 2 Apr 2018  路  5Comments  路  Source: scalameta/metals

.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?

All 5 comments

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.

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

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.

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.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

laughedelic picture laughedelic  路  4Comments

tgodzik picture tgodzik  路  4Comments

romanowski picture romanowski  路  4Comments

olafurpg picture olafurpg  路  4Comments

tpolecat picture tpolecat  路  3Comments