some devices , the logcat is really fast , and it often cause the page to die
some devices , the logcat is really fast , and it often cause the page to die when i open logcat and wait for a while , how to solve this problem
Do you mean the log function in the STF UI, or just adb logcat?
the log in stf ui I find the reason , it's because the logcat puts chinese encoded with utf8 , and the logcat module cannot parse chinese , but i do not know how to make it compatible with chinese . do you have any suggestions?
You don't need to do anything with the Chinese, it's not the reason that makes the UI die. You will find out the binary.js in the adbkit-logCat which is in the node_modules, some parser codes have problems. If you have the android source code, you can see that a struct about logcat has changes when the target > 19(maybe 21, I forgot), the cursor is not on the correct index on the entry buffer when program want read the time, pid, tid... , so in the page, we can see a lot of strange contents which make no sence. In a word, when target<=19, the length of entry data is less than the same data when target>19, change the cursor, and maybe you need a "if-else", then everything will work.
I also encountered this problem , if I open the logs, sometime later, the browser will die! Do you have any solutions about this problem?
Hi @l674964417 ,
I'm not sure that it will solve your problem but you can change: var maxEntriesBuffer = 3000 defined in : res/app/components/stf/logcat-table/logcat-table-directive.js to some smaller value, lets say 500 even less(everything depends mostly from how much information is stored for each line of log produced by logcat). What is important. This is not perfect solution, as you will decrease number of information stored in logcat buffer. It should solve your problem, but this problem should be fixed in proper way. I'm working on some modifications under logcat section for STF. I have hope that I will find some time to finish it during this weekend and I will try ask somebody from STF team, to look at my changes.
@l674964417 @lukzeg It's indeed a problem that the web page of STF would hang when logcat output at a fast and furious rate. My solution is adding rate limiter both in websocket and device components:
var RateLimiter = require('limiter').RateLimiter
var logcatRateLimiter = new RateLimiter(10, 'second') // allow 10 msg to be sent every 1 second
... ...
.on(wire.DeviceLogcatEntryMessage, function (channel, message) {
if (logcatRateLimiter != null) {
logcatRateLimiter.removeTokens(1, function () {
if (logcatRateLimiter != null) {
socket.emit('logcat.entry', message)
}
})
}
@sorccu It might be a performance problem in Browser, any suggestion to resolve this kind of problem?
@thinkhy I use rate limiter, but it cause that the log in web is not real-time
@qin-young yes, it's as expected and better than hitting browser crash ... Myabe the best way is to filter log entries