Hook into the server on_stdout and on_stderr to log server logs#20
Conversation
This is still a little clunky but I think it is valuable to get the server logs as well as client-side logs
| local output = table.concat(data, "\n") | ||
| if output and output ~= "" and output ~= "\n" then | ||
| Logger.debug("Processing stdout: " .. output) | ||
| Logger.log(output, vim.log.levels.INFO, { server = true }) |
There was a problem hiding this comment.
In my opinion, the Logger should accept a { prefix = "Server" } option instead of { server = true } boolean. The logger would then know how to format the prefix to [SERVER]. I think the logger shouldn't need to know what a server is; it should know how to format prefixes. Also, booleans can only grow in number as more prefixes are added.
There was a problem hiding this comment.
Yeah this is a better idea. The more I think about it the more I think we should just pass stdout and stderr straight through without worrying about prefixing or saying "this is a client log and that is a server log". The logs are different looking anyways.
There was a problem hiding this comment.
The more I think about it the more I think we should just pass stdout and stderr straight through without worrying about prefixing or saying "this is a client log and that is a server log". The logs are different looking anyways.
Exactly, TBH I don't know why you need a client log... eca-emacs and eca-vscode only log server logs (stderr) and that's enough for debugging
There was a problem hiding this comment.
Hum log what client is sending/receiving is a nice to have, but not sure we need that now, other editors don't have
There was a problem hiding this comment.
I think having client logs are useful 🤷 There is a lot of lua code for these bigger plugins
|
Also removed |
This is still a little clunky but I think it is valuable to get the server logs as well as client-side logs