immersivecognition / unity-experiment-framework

UXF - Framework for creating human behaviour experiments in Unity
https://immersivecognition.github.io/unity-experiment-framework/
MIT License
215 stars 41 forks source link

Session Logger - Public Log Method #53

Closed jackbrookes closed 3 years ago

jackbrookes commented 3 years ago

Allow manual logging with public Log method.

thefirstfloor commented 3 years ago

Exactly what I ran into today!

I was researching the way to have an 'event logger' to store timestamp+message on events like: "clicked button", or "timelimit reached". Right now ALL data in the debug.log is saved in the sessionlog, this is useful for debug purposes but not as final data outcome. One approach might be to only store messages with a custom keyword from the unity debug.log console, or better even, turn it around and make a custom (singleton) event-logger which optionally also prints to the unity console. My 2cnts

jackbrookes commented 3 years ago

It's fairly easy to do this yourself, you can create what you described, have it convert the list into some text, and then run session.SaveText(logText);.

I think in general its not great practice to do this because it can be difficult to process & analyse the data. If you have only a few events you can of just do currentTrial.result["clicked_button_time"] = Time.time; and you have the timestamps over several columns.

But you are right that this would a nice addition to UXF. I think I will add public logging, singleton access, and check box to log all Debug.Log calls. In my own experiments I have been just putting prefixes in the log calls so they can be easily filtered in the data analysis stage.