[solved] sort logger vars
hi! i hassle with the logger because i am not able to sort the variables for the logfile.
it would be nice if all variables from different loops would stand in the same column.
is there any way to do this? or is there another element to set the vars other than the logger, i.e.
log "cogPos_pic"
log "cogPos_age"
log "cogPos_gender"
log "cogPos_valence"
log "response_cogPos_keyboard_response"
log "response_time_cogPos_keyboard_response"
log "correct_cogPos_keyboard_response"
???
thanks a lot,
ben
Comments
ps: i don't understand why the logger sets the variable names for almost every new loop but for some loops not...
Hi Ben,
The
loggerwrites one row of data every time that it is executed. So you can never have data from two different loops, or more generally from two different calls to alogger, in the same row. But if you want you can write to the logfile using Python script, in which case you can use any kind of format you'd like. This is described here:Do you mean that you get a new row of column headers in the middle of your logfile? This happens if you have more than one different
loggeritems in your experiment, which start cross-talking. Usually, you would have only a singleloggerin the experiment, although this single item can occur at multiple positions in the experiment (i.e. by re-using the samelogger, rather than creating a new one).Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
sorry, i already edited my question before your answer. i ment "it would be nice if all variables from different loops would stand in the same COLUMN."
the variables have different names (from different conditions) but contain the same kind of data. therefore it would be nice if the logger do not shuffle the order of variables (columns) by itself but keeps my specified order (see example above). i see no pattern in the "shuffle method".
in the end i gues i will script my own logger but i have a certain compulsion to understand why things happen
and maybe it helps another user aswell...
thanks a lot!
ben
hello again, i couldnt find a way to write variables with self.log().
i have variables set in a "setup-script" like
and the variable [num] in the loop which identifies a certain pic in the sketchpad ([var[num]pic]).
how could i write the name of the pic into the log? and how can i catch key_reponses to be written in the log?
i really try to fix problems by myself but somehow the docu and me are no good friends yet...
The
loggeralways arranges columns alphabetically, independently of the order of thelogstatements in the script. But different variables will never be written to the same column: One variable = one column. So if you want to have a particular 'kind of data' to always appear in the same column, you need to make sure that the data is stored in the same variable.In an
inline_scriptyou have to useself.get()to retrieve an experimental variable. So if you have defined some variable calledmy_varin aloopitem, you would log it like so:Or for the response variables that are set by a
keyboard_response:See also:
Check out SigmundAI.eu for our OpenSesame AI assistant!
thank you so much! now everthing works fine!
i just had to find out how to write more than 1 string to write all variables in one line:
thanks a lot again!