Need a better log system with level and module classification
Issue by shanjian from Fri Jan 31 08:23:47 2014 Originally opened as https://github.com/UWNetworksLab/UProxy/issues/173
Right now the log is done through console.log. There are too many noise. In realworld situation, it could be even more difficult for debugging. A better log system is needed. Following are some of the requirement I can think of now.
- log will be classified in levels, like (debug, info, warning, error)
- log should be better tagged with modules. If identity module is being worked on, it can show a deeper level of log info.
- log should be recorded in a local storage, and upload to server for analysis in case of incidence analysing.
- log should be encrypted when necessary.
assign for consideration.
Comment by iislucas from Fri Jan 31 19:16:34 2014
Yes!
Also, logs should be time-stamped.
A lot of this should happen in Freedom. Currently, my understanding is that Freedom pushes logs from web-workers out to the top-level.
Comment by iislucas from Tue Feb 25 23:41:06 2014
Maybe use https://stackoverflow.com/questions/11308239/console-log-wrapper-that-keeps-line-numbers-and-supports-most-methods
Comment by iislucas from Wed Feb 26 01:16:51 2014
(Note: Console messages from module code are not relayed by freedom (in chrome), as the webworker api in chrome now implements console, and relays those messages directly.)
Also need an easier way for users to access these consolidated logs, eg during the QA process. I'd recommend inserting a quiet link on the login/logout screen; clicking the link could copy the logs to the clipboard.
Blocks on https://github.com/freedomjs/freedom/issues/90
A version has been done here: https://github.com/uProxy/uproxy-lib/tree/dev/src/logging