Logging guidelines

https://github.com/eclipse-theia/theia/wiki/Coding-Guidelines#logging says we should use console.log instead if ILogger. However, it does not explain why. How do we handle trace logging, etc. if we cannot configure the log output?

[original thread by Thomas Mäder]

I believe this was the main reason for using console over ILogger: https://github.com/eclipse-theia/theia/issues/1675#issuecomment-450819568

I however do not know the way forward in your specific use case unfortunately :frowning:

all calls to console are intercepted on the backend and frontend and forwarded to https://github.com/eclipse-theia/theia/blob/0511ab51e6e50324c0b304ff884ac2798a5600e2/packages/core/src/node/console-logger-server.ts#L56

default implementation then delegates to the original console, custom implementation can log somewhere else

I’ve updated the guidelines that one can call console.trace and console.debug as well, and how one can configure the logging level during development.

Generally, we have nowhere near enough log output to retrace the flow of exeuction, even at debug level.

Hi Thomas, what is a use case? I usually using the node debugger instead of console.debug to investigate what is going wrong.