tinylog
Tagged: processing.js, tinylog
- This topic has 6 replies, 1 voice, and was last updated 6 years ago by
Ian Lawrence.
-
AuthorPosts
-
7. April 2015 at 11:29 #1126
Ian Lawrence
GuestMorning 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
7. April 2015 at 12:34 #1127audiocommander
KeymasterHi 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,
Michael7. April 2015 at 12:46 #1129audiocommander
KeymasterOh: 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.7. April 2015 at 13:43 #1130Ian Lawrence
GuestHi 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…
8. April 2015 at 11:26 #1131audiocommander
KeymasterHi 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,
Michael8. April 2015 at 11:34 #1132audiocommander
Keymasteras 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!
8. April 2015 at 13:06 #1133Ian Lawrence
GuestMorning 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
-
AuthorPosts
- The topic ‘tinylog’ is closed to new replies.