etherealengine icon indicating copy to clipboard operation
etherealengine copied to clipboard

Replace console.log() usage in the client with ClientLogger usage

Open dmitrizagidulin opened this issue 3 years ago â€ĸ 0 comments

On the server side, we are not exclusively using Pino.js logger methods (logger.info(), .error(), .warn() etc) instead of console.log(). This allows us to aggregate console and error logs by sending them to Elasticsearch for indexing.

This task is to do the same for the client side. Since Pino.js is a Node-only library, we will create a lightweight logger.ts module that will output a logger instance with the same API as Pino's logger.

  • [x] Implement a ClientLogger module
  • [ ] Replace all client-side console.*() usage with logger.info() etc.
  • [x] Initially, the logger will still only output to the browser console.
  • [x] Once all logging is converted to use the clientlogger, we will hook it up to an external log aggregator service (Rollbar, or our own server-side logging API endpoint).

dmitrizagidulin avatar May 13 '22 20:05 dmitrizagidulin