Page 1 of 1

logging objects

Posted: 15:06, 03 Mar 2015
by randomstuff
would it be possible to provide a more useful hyper.log in means of being able to logging objects?
if you try to hyper.log a whole object it just says [object Object], which isn't very useful

browser consoles usually have an ability to expand the object and see through its properties.

or would it be possible to use external console, such as google chrome console?

Re: logging objects

Posted: 10:48, 04 Mar 2015
by Fredrik
[object Object] is the Javascript default conversion of Object to String. As far as I know, it cannot be changed.

However, we have a function evothings.printObject that may do what you want.

Re: logging objects

Posted: 13:54, 05 Mar 2015
by randomstuff
i know this is a default javascript string representation of object, that's why i asked whether would it be possible to print it in a more intelligent way, such as chrome or firefox does in the console.

by the way, evothings.printObject doesn't work :(

Code: Select all

LOG: [ERR] TypeError: undefined is not a function (evaluating 'evothings.printObject(distances)') [app.js: 130]


or should i copy paste the function definition from the evothings.js?

Re: logging objects

Posted: 14:17, 05 Mar 2015
by Fredrik
You can either include evothings.js, like so, or copy/paste the function.

Re: logging objects

Posted: 11:36, 06 Mar 2015
by randomstuff
nope, it gives the error even with this included


<script src="libs/evothings/evothings.js"></script>

.. undefined is not a function (evaluating 'evothings.printObject ..

Re: logging objects

Posted: 12:10, 06 Mar 2015
by Fredrik
Do you have the directories "libs/evothings" in your project folder? If not, the file "evothings.js" won't be there, the WebView will get a 404 when trying to load it, and will silently disregard the <script> tag.

Re: logging objects

Posted: 09:56, 11 Mar 2015
by randomstuff
yes, i have both :/

Re: logging objects

Posted: 11:50, 11 Mar 2015
by Fredrik
Then I'm out of ideas. You'd better copy/paste the function.