chewing / libchewing

libchewing - The intelligent phonetic input method library
https://chewing.im/
GNU Lesser General Public License v2.1
357 stars 89 forks source link

Ensure we have detailed error logging for all ERROR path #510

Closed kanru closed 2 months ago

kanru commented 2 months ago

Is your feature request related to a problem? Please describe.

For our first Rust rewrite release it will be very important that we have all the information we need for debugging

Describe the solution you'd like

Current log like

[ERROR chewing::dictionary::trie_buf] [!] Failed to write updated user dictionary due to error.

should contain more information for troubleshooting.

Also the startup logging

[INFO  chewing::path] Using CHEWING_PATH /usr/share/libchewing
[INFO  chewing::path] Search files ["word.dat", "tsi.dat"] in /var/home/kanru/.chewing
[INFO  chewing::path] Search files ["word.dat", "tsi.dat"] in /usr/share/libchewing
[INFO  chewing::path] Load ["word.dat", "tsi.dat"] from /usr/share/libchewing
[INFO  chewing::path] Using CHEWING_PATH /usr/share/libchewing
[INFO  chewing::path] Search files ["swkb.dat"] in /var/home/kanru/.chewing
[INFO  chewing::path] Search files ["swkb.dat"] in /usr/share/libchewing
[INFO  chewing::path] Load ["swkb.dat"] from /usr/share/libchewing
[INFO  chewing::path] Using CHEWING_PATH /usr/share/libchewing
[INFO  chewing::path] Search files ["symbols.dat"] in /var/home/kanru/.chewing
[INFO  chewing::path] Search files ["symbols.dat"] in /usr/share/libchewing
[INFO  chewing::path] Load ["symbols.dat"] from /usr/share/libchewing

Should show all actually loaded resources.