Logging serial input in Logfile (Builder)

OS: Win 7
Version:3.24
Standalone

What are you trying to achieve?
I am programming an emotion recognition paradigm for fMRI.

What did you try to make it work?:
I used custom code to get a connection with a serial port.
begin exp:
import serial
port = serial.Serial(“COM3”, 9600, timeout=0, parity=serial.PARITY_NONE, bytesize=serial.EIGHTBITS, stopbits=serial.STOPBITS_ONE)

begin routine:
line = port.readline(2)

What specifically went wrong when you tried that?:
I need the timing from the serial input in my logfile. How can I do that? It logs everything else (Stimuli, responses etc.)

I hope you guys can help me out, otherwise I have to switch to another program, which I want to avoid at any costs!