|
I tried to capture the log output using Application.RegisterLogCallback but it did not work:
The above code dont work, the variable logcalled not incremented.
Am I missing something? (question was edited to clarify it)
(comments are locked)
|
|
There seems to be a bug with this. The only way I could get RegisterLogCallback to work with our in-game logging system was by calling RegisterLogCallback every frame. If I just called it at startup, it would only call the logs that were in that initial frame. It seems from my testing that you can't register it until at least two frames after starting. You don't need to call it every frame, since once it "takes," it's set.
Mar 02 '10 at 07:05 PM
burnumd
Indeed! After some tests, registering on the third frame solve it. But wtf, and if in the next update this changes to the fourht frame? Just kidding of course, its just to strange to be confortable, but whatever, works for now.
Mar 04 '10 at 11:45 AM
Andre Galastri
The issue apparently was fixed at some point, in 3.4.2 a callback registered in the very first frame works fine.
Nov 28 '11 at 06:57 PM
volk
(comments are locked)
|
|
RegisterLogCallback should not redirect the log output - it should install an additional handler, so the log output goes to the editor log, and your function should be called. Are you seeing logcalled being incremented as log messages are printed? If so, then everything works as expected. Thats the problem, 'logcalled' is not being incremented! The example on the unity site uses a Javascript, could this be relevant?
Feb 17 '10 at 06:53 PM
Andre Galastri
(comments are locked)
|
|
The JavaScript example in Unity's documentation also does not work (unless you use the delayed register workaround) . Has anyone logged a bug report?
(comments are locked)
|
