Coder Social home page Coder Social logo

Comments (3)

esdalmaijer avatar esdalmaijer commented on August 20, 2024

Thanks for the heads-up!

I'm not quite sure what the best behaviour would be. PyGaze could automatically split up the message into more than one string, but this would result in odd log entries. Alternatively, we could print a warning to the console, but this would likely be missed. Finally, we could throw an exception when someone tries to log more than 128 characters, but image this happening in the middle of an experiment: you wouldn't really care that the entire message wasn't logged, but would be royally ticked off by the unexpected crash.

What do you think?

from pygaze.

Klemtonius avatar Klemtonius commented on August 20, 2024

Hi Edwin,
I think the best option would be to split the message into more than one text line. Log entries would become a bit odd, but then again I think it's fine if people know what to expect. So there could be a clear warning and explanation in the help section for this function. Analyzing the eyelink logfile is a manual endeavour anyway (at least making scripts etc), so I don't think having to retrieve a variable from multiple lines would impose that much more of a hassle.
And yes, you would be ticked off if the experiment crashes halfway through; but on the other hand you would at least know, and make sure everything goes right after your pilot participant. Can you imagine how ticked off you would be if you never got that warning or crash, only to find out you lost important data after 30 participants? :p

CheersJosh
Date: Thu, 30 Apr 2015 03:07:32 -0700
From: [email protected]
To: [email protected]
CC: [email protected]
Subject: Re: [PyGaze] Logging long variables (e.g. lists) to the edf file (#35)

Thanks for the heads-up!

I'm not quite sure what the best behaviour would be. PyGaze could automatically split up the message into more than one string, but this would result in odd log entries. Alternatively, we could print a warning to the console, but this would likely be missed. Finally, we could throw an exception when someone tries to log more than 128 characters, but image this happening in the middle of an experiment: you wouldn't really care that the entire message wasn't logged, but would be royally ticked off by the unexpected crash.

What do you think?


Reply to this email directly or view it on GitHub.

from pygaze.

smathot avatar smathot commented on August 20, 2024

By the way, if we're going to fix up the log() function anyway, it would be a nice occasion to fix two other annoying things:

  1. Make sure that it's unicode safe, which means converting all str objects to unicode before passing them on to pylink. We would have to assume a default encoding for str objects (utf-8 probably), and mention this in the docs. This should both work:
exp.pygaze_eyetracker.log(u'été')
exp.pygaze_eyetracker.log('été') # Assuming utf-8
  1. Quoting and escaping the log message would help during parsing. Right now you get:
MSG [TIMESTAMP] Some long string with "quotes"

Which could become:

MSG [TIMESTAMP] "Some long string with \"quotes\""

What do you think? It's not necessary, but it's a nice touch.

from pygaze.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.