Skip to content

Fix and improve server logging #2492

Open
@jneira

Description

@jneira
  • hls architecture is complex, with many moving pieces (hie-bios, hiedb, ghcide, plugins, etc) and many points of failure so we need a good log setup allowing users and maintainers trace bug causes as fast as possible
  • Now, afaics the logging system has some flaws:
    • It uses different logging frameworks, config options and criteria about what and where is the output
    • Logging levels are not consistent across components
    • And the worse thing, not always errors are reported in the log and users ends with a no working hls session with no clue about why is the cause

As @alanz suggested in this issue about harmonising logging :

  • how and what are we going to log? Tapping into the LSP expectations makes sense, which seems to be to use stderr, which can then be managed per process and per client.
  • Which logging framework will we use? In my mind this should be common across haskell-lsp, ghcide, and hls

I would add:

  • ensure all errors even catastrophic ones are reported with the max info available
  • use proper error levels setup with at least error, info and debug
  • move all actual traces about rules to debug, as afaics the main information they give is what rule was fired and how many time it took, so useful for performance analysis (but only partially)
  • expose all log level selection in all components and make it configurable up down from hls via cli arg and lsp config

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..type: enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions