tinylog

Home Forums Procoding tinylog

This topic contains 6 replies, has 1 voice, and was last updated by  Ian Lawrence 2 years, 1 month ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1126

    Ian Lawrence

    Morning again,

    I have an error with a certain class of processingjs sketches on procoding, in both iOS and OS X.

    ‘Processing.js: unable to execute pjs sketch: ReferenceError: can’t find variable: tinylog’

    The same sketches work fine in the processing ide, or if embedded in web pages. I suspect that there is something in procoding?

    kind regards

    Ian

    #1127

    audiocommander
    Keymaster

    Hi Ian,

    that’s hard to answer without further information. What do you mean with “a certain class of processingjs sketches”?

    Does it happen with all processing.js sketches or just with some of them?

    tinylog is the console that shows up with logs and it’s built into processing.js.
    Did you maybe change the processing.js version by having a newer processing.js in your documents folder?

    I just checked just to be absolutely certain, and for me it works with the provided examples and the bundled processing.js version.

    Best,
    Michael

    #1129

    audiocommander
    Keymaster

    Oh: it just occurred to me in the other thread: do these sketches maybe have many (or some big) resources?

    Resources are loaded and injected dynamically (all with JavaScript), and if you have too many of them, that’s when things might go wrong, because timing is crucial and there might be some overlaps, e.g. when the loading and DOM injection of resources takes too long. Note that there are also time- and memory-related limitations on iOS like script running times.

    Does this message disappear when you reload the affected sketch a couple of times?
    If yes, you should reduce the amount of resources you are using.

    #1130

    Ian Lawrence

    Hi Michael,
    It is a big resource, but all of it is loaded every time. Only certain functions / objects of this resource are called in any sketches*, although its all loaded every time. For one kind of resource ( a particular drawn chunk) I always get the error on procoding, on iOS or OS X. I don’t get the error in the processing IDE. Reloading (refreshing) does not make it go away.

    I was not aware that tinylog was a part of processingjs, so apologies for any aspersions cast…

    The sketch does work on the wild web, where the same resources are loaded from a remote server, as is the sketch: like this: http://supportingphysicsteaching.net/zztestphase/En_BicycleFreewheelShiftedSupport.html

    I have not updated processingjs in months, although I know that there is a new one out there..

    Maybe not urgent, but I much prefer to develop in Procoding, rather than the slew of IDE/Browser/text processor

    kind regards

    Ian

    * there is a good reason for this…

    #1131

    audiocommander
    Keymaster

    Hi Ian,

    I’m guessing at some point in your code there might be a javascript console warning or error raised. I just saw that there might be an issue in Procoding’s processing.js template to prevent these messages from being routed to the processing.js version of tinylog… will look into that.

    Thanks again for reporting this.

    Best,
    Michael

    #1132

    audiocommander
    Keymaster

    as a workaround:
    can you test adding this line somewhere at the top of your sketch and see if it works:

    window.tinylog = Processing.logger;

    A fix will also be included with the upcoming updates!

    #1133

    Ian Lawrence

    Morning Michael,

    I’ve been off in the wilds of python for a bit. Back to pleasure now…

    Dropping this in as a first line does indeed allow the sketch to run as expected in procoding OSX (not checked in iOS yet…)

    Thanks

    Ian

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘tinylog’ is closed to new replies.