emqx / MQTTX

A Powerful and All-in-One MQTT 5.0 client toolbox for Desktop, CLI and WebSocket.
https://mqttx.app
Apache License 2.0
3.9k stars 447 forks source link

Add log system #367

Closed ysfscream closed 3 years ago

oceanlvr commented 3 years ago

PRD draft

Implement a log information system that can record connection information, subscription information, errors, and warnings.

solution?

log item example?

normal:

${time} ${LogLevel}-${Event-name}:   ${detail}

error/warning/undefined behavior

${time} ${LogLevel}-${Event-name}:   ${detail}
${error/warning/undefined behavior content}

Where I should record to log?

ref document: https://www.jianshu.com/p/a6c643a87ef9

ysfscream commented 3 years ago

You can also refer to this package.

Just a simple logging module for your Electron application.

https://www.npmjs.com/package/electron-log

oceanlvr commented 3 years ago

solution:

  1. Create a new log file
  2. Appender add log information to file
  3. Log page spy on the newest log file
  4. Trigger update event for log page
ysfscream commented 3 years ago

Finished on https://github.com/emqx/MQTTX/releases/tag/v1.5.0