Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Getting extensions to print debug messages

jpgjpg
edited November 2014 in OpenSesame

Hello, love the new changes in 2.9.0!

I'm giving writing extensions a go, and I was following the extensions guide and example extension, but I can't seem to get the example to correctly execute the debug.msg()

I'm running OpenSesame in debug mode, and through the console I can from libopensesame import debug and it functions as expected.

But when I try to activate the example extension, nothing happens when any of the conditions are met (on activation, run experiment, new item etc)

Any ideas what I'm doing wrong?

Comments

  • edited 7:50PM

    Good to hear that you're trying out the extension framework!

    But when I try to activate the example extension, nothing happens when any of the conditions are met (on activation, run experiment, new item etc)

    Well, the example extension doesn't perform any overt task, it only prints some debugging output, which you should see in the console. Things like: example.py(38).activate: Example extension activated. Also, during startup, OpenSesame lists all extensions and the events that they support like so:

    _base_extension.py(49).__init__: creating example
    _base_extension.py(439).supported_events: extension example supports event_close
    _base_extension.py(439).supported_events: extension example supports event_end_experiment
    _base_extension.py(439).supported_events: extension example supports event_new_item
    _base_extension.py(439).supported_events: extension example supports event_open_experiment
    _base_extension.py(439).supported_events: extension example supports event_purge_unused_items
    _base_extension.py(439).supported_events: extension example supports event_regenerate
    _base_extension.py(439).supported_events: extension example supports event_rename_item
    _base_extension.py(439).supported_events: extension example supports event_run_experiment
    _base_extension.py(439).supported_events: extension example supports event_save_experiment
    _base_extension.py(439).supported_events: extension example supports event_startup
    

    If you don't see any output of this type, and don't get any 'Extension misbehaved' error messages either, then OpenSesame probably hasn't loaded the extension at all. Is it in the correct folder? Have you enabled the extension in the extension manager?

    Cheers!
    Sebastiaan

  • jpgjpg
    edited 7:50PM

    Hi Sebastiaan,

    Well, the example extension doesn't perform any overt task, it only prints some debugging output, which you should see in the console. Things like: example.py(38).activate: Example extension activated.

    This is what I'm having a problem with; there isn't any debug output

    If you don't see any output of this type, and don't get any 'Extension misbehaved' error messages either, then OpenSesame probably hasn't loaded the extension at all. Is it in the correct folder? Have you enabled the extension in the extension manager?

    On startup (with the --debug flag) it doesn't give me the above output, just the standard message:

    Python 2.7.6 Type "help()", "copyright()", "credits()" or "license()" for more information. Type "modules()" for details about installed modules and version information. Use the "print([msg])" statement in inline_script items to print to this debug window.

    When the experiment is run it gives the usual debug output:

    qtopensesame.py(916).run_experiment: using <class 'libqtopensesame.runners.multiprocess_runner.multiprocess_runner'> runner qtopensesame.py(857).get_ready: experiment.py(200).__init__: reusing existing pool folder experiment.py(202).__init__: pool folder is 'c:\users\jgoodl~1\appdata\local\temp\tmp3kyaeb.opensesame_pool' experiment.py(586).open: opening from unicode string experiment.py(302).from_string: building experiment item_store.py(71).new: creating sequence item_store.py(85).new: loading core item 'sequence' from 'libopensesame' item_store.py(71).new: creating notepad item.py(307).from_string: item_store.py(71).new: creating sketchpad item_store.py(85).new: loading core item 'sketchpad' from 'libopensesame' _base_element.py(55).__init__: textline experiment.py(200).__init__: reusing existing pool folder experiment.py(202).__init__: pool folder is 'c:\users\jgoodl~1\appdata\local\temp\tmp3kyaeb.opensesame_pool' experiment.py(586).open: opening from unicode string experiment.py(302).from_string: building experiment item_store.py(71).new: creating sequence item_store.py(85).new: loading core item 'sequence' from 'libopensesame' item_store.py(71).new: creating notepad item.py(307).from_string: item_store.py(71).new: creating sketchpad item_store.py(85).new: loading core item 'sketchpad' from 'libopensesame' _base_element.py(55).__init__: textline Starting experiment as ExperimentProcess-1 canvas.py(64).init_display: morphing into xpyriment Expyriment 0.7.0 (Revision 7a6b73d; Python 2.7.6) File: opensesame.exe (6a8b7f) Warning: OpenGL does not support window mode. OpenGL will be deactivated! sampler.py(58).init_sound: morphing into legacy openexp.sampler._legacy.init_sound(): sampling freq = 48000, buffer size = 1024 openexp.sampler._legacy.init_sound(): mixer already initialized, closing experiment.init_log(): using 'C:/E-PRIME\quickrun.csv' as logfile (utf-8) experiment.run(): experiment started at Wed Nov 05 10:54:55 2014 keyboard.py(41).keyboard: morphing into legacy keyboard.py(41).keyboard: morphing into legacy canvas.py(47).canvas: morphing into xpyriment html.py(146).render: OpenSesame 2.9.0 <i>Hesitant Heisenberg</i> html.py(146).render: OpenSesame html.py(146).render: 2.9.0 html.py(146).render: html.py(146).render: Hesitant html.py(146).render: Heisenberg sampler.py(74).close_sound: morphing into legacy canvas.py(80).close_display: morphing into xpyriment The escape key was pressed.

    The extension is installed and enabled and it comes up in the menu:

  • edited 7:50PM

    Right, I see. You're looking for the debug output in the wrong place. It won't appear in the debug window, but is printed to the standard output. In Windows, you won't see this unless you start OpenSesame from the command line, or through a bash-terminal emulator.

    When you start an experiment, OpenSesame temporarily reroutes the standard output to the debug window. This is helpful to debug your experiment. But the debug output generated by the GUI, while no experiment is running, is just printed to the standard output. That's why you don't see anything in the debug window. Does that clear things up?

  • jpgjpg
    edited 7:50PM

    Ah, that makes sense, thank you.

    I did try launching it with --debug from cmd and console2, though there is still no output whatsoever there. Is there a convenient way to do this in Windows?

    When using the WinPython portable version (2.8.3) it does give a debug output to the cmd terminal correctly.

    I'm sure I'm missing something obvious here!

  • edited 7:50PM

    Windows isn't very terminal-friendly, and to be honest I'm not too familiar with the Windows command prompt. (I use Linux almost exclusively.) What you could is install git, which will also install a bash emulator. From this emulator you can start OpenSesame in debug mode and see all the output. See also this blog post, which I wrote a while back:

  • jpgjpg
    edited 7:50PM

    Wonderful, I'll have a play with Git, been meaning to for a while. Failing that I'll reboot in Linux. Thanks for your help :)

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games