Skip to content

Logs

Log files can be saved alongside the experiment files. Enable logs on the General Tab.

Log Options

Control values, Metric values, Session information, and custom text can be written to the log. The log files are saved in the data block folder with the name {GIZMO_NAME}_user_log.{FILE_FORMAT}. The file format can be a tab-delimited TXT file, or a comma-separated CSV file.

All log entries except for raw user text contain a log number and timestamp. Enable Companion Epoc to also capture the log number and timestamp in the data block as an epoc event.

Control Logging

Control values can be automatically logged when they change value. If Session Controls are enabled, the values can also be logged when a new Session, a new Block, or a new Trial starts. They can also be logged manually with the writeControlValue method.

Control Log Options

Example output line in the log file

22 4.013 CONTROL: Frequency 1000

This is an ID number, timestamp, type, control name, and value.

Metric Logging

Metric values can be automatically logged when they change value. If Session Controls are enabled and the metric is categorized as a Session, Block, or Trial metric, then the metric value can also be logged at the end of that time period. They can also be logged manually with the writeMetricValue method.

Metrics Log Options

Example output line in the log file

6 2.131 METRIC: Correct 3

This is an ID number, timestamp, type, metric name, and value.

Session Logging

Session information (when new sessions, blocks, and trials start) can be logged automatically. This includes the start of a session, block, or trial, or when a session resumes.

Session Log Options

Block and trial start logs contain the block/trial number. Session start logs contain the name of the phase and the number of trials / blocks defined at the start of the session.

Example output line in the log file

1   0.641   SESSION:    Start   P*  5   2
2   1.505   BLOCK:      Start   1       
4   1.507   TRIAL:      Start   1
5   1.629   TRIAL:      Start   2
6   2.145   TRIAL:      Start   3
7   2.288   TRIAL:      Start   4
8   2.461   TRIAL:      Start   5
9   2.602   BLOCK:      Start   2
11  2.604   TRIAL:      Start   1
12  2.762   TRIAL:      Start   2
13  2.949   TRIAL:      Start   3
14  3.122   TRIAL:      Start   4
15  3.294   TRIAL:      Start   5

For sessions, this is an ID number, timestamp, event name, event type, and phase information. For blocks and trials, this is an ID number, timestamp, event name, event type, and counter value.

Custom Text Logging

Use writeSessionEntry to add timestamped notes to the log file.

Example output line in the log file

12 1.265 USER: my user notes

This is an ID number, timestamp, type, and string value.

Use writeRawText to add raw text to the file with no numbers or timestamps.

Example output line in the log file

raw text with no formatting

This is just the string value

Methods

All log methods have the form p_Log.{METHOD}. Type p_ in the Pynapse Code Editor and let the code completion do the work for you.

writeControlValue

p_Log.writeControlValue(cname)

Write a timestamped control value to the log file.

Inputs Type Description
cname string name of control to write to log file

writeMetricValue

p_Log.writeMetricValue(mname)

Write a timestamped metric value to the log file.

Inputs Type Description
mname string name of metric to write to log file

writeRawText

p_Log.writeRawText(strg)

Write raw text to the log file. Make sure to add the newline character (\n) at the end of the string to advance the log file to the next line.

Inputs Type Description
strg string raw text to write to log file

writeSessionEntry

p_Log.writeSessionEntry(strg)

Write a custom timestamped entry to the log file.

Inputs Type Description
strg string raw text to write to log file