Console logging - I can't see it


#1

First off, thank you for releasing the SDK. It is great to have something to test and play with before JIBO arrives.

I am new to Atom, javascript in general, but am a very experienced programmer. I am trying to debug my skill and go through the samples (which are great) and see console messages that are in the code - i.e. console.log(’…’); I cannot see any of these messages in my UI. I have brought up the “Developer Tools Window”, and made sure “All” is selected on the Console output filter. Yet, none of these log messages are appearing. I do see warnings or stack traces in there, but none are the messages from the console.log() commands. I have even put console.log() commands in the main.js file right after the start() and jibo.init() functions thinking maybe they weren’t being call being in the other .bt files. Still no luck.

There must be something basic that I am missing. Can someone help a newbie to get this working?

P.s. I also installed the atom console-log package just in case, and that didnt seem to change anything.
P.s.s. I should mention I am on a Mac

Thank you in advance.


#2

Hi Arthur…what happens if you add a simple “ExecuteScript” behavior as the first item under your main sequence with a console.log output?

() => {
  console.log("Hello.");
}

Do you get any output in your skill when you run it with something as simple as this?


#3

Hi Michael,

I created a new project and just added an “ExecuteScript” as the first child in the sequence, and added your code. In the Developer tools window, I get this under the Console:
/Users/arthurwalasek/.atom/packages/jibo-sdk/node_modules/jibo-tools/lib/jibo-tools.js:9 indexPath /Users/arthurwalasek/github/test-console-log/index.html
2016-04-07 08:43:52.252 /Users/arthurwalasek/.atom/packages/jibo-sdk/node_modules/jibo-tools/lib/jibo-tools.js:9 remoteRegistry undefined

thats it. I don’t see “Hello”. Is there somewhere in Atom (besides the Developer tools window) where console output is displayed?

BTW - Jibo does do his animations and sound in the simulator. And I did save the .bt file after making the changes.


#4

By chance, did you run npm install inside of the new skill directory after creating the new project? At least on my machine, I need to do this on every new project or I run into errors like the one you saw. If not, try that to see if it helps.

Per your second question, your console.logs should output to the Developer tools window directly.


#5

I had not done the “npm install” before. I just tried doing that, and there was no change.


#6

I think we’ll need to pull in @Admin.JiboSupport at this point to find out if he’s seen your “remoteRegistry undefined” error from jibo-tools.js before.


#7

Ok - I figured it out. It was user error.

For those that are confused like me, when you run the simulator (run the skill) in the window that opens up, there is a separate “Developer Tools” window that can appear (available from the Electron menu). It is in this Developer Tools window that the console messages appear (not the one that is associated with Atom).


#8

Hi Arthur,

Very glad you were able to get that figured out and my apologies for not popping in sooner!

For anyone else that might have this question, as Arthur said Electron (the platform on which our simulator runs) provides a debugger console that can be viewed using these steps.

Also, thank you Michael for your input as well!

-John


#9

Hello everyone,

I am downloading Atom in Windows 10, but I cannot get it to work. I did install a package called “script” in order to run code.
The code seems to be correct as I don’t get any errors; however, the main problem is that it doesn’t print anything of what I tell the computer to print.
Specifically, I am working with functions in Javascript.

I would immensely appreciate anyone’s help.

Thank you


#10

Hi mcamila11. Could you show me what code you’re using that’s causing the error? Also, could you let me know what error specifically is appearing when you use that code? I’m on Windows 10 at the moment with Atom and the Jibo SDK installed in working order, so I can help debug if I know more details about your issue.


#11

Michael, thank you so much for willing to help.
I sent you a picture of a simple function that is supposed to print backwards whatever you type. At the bottom left there is a small green checkmark that lets me know there is nothing wrong with the code in order to execute. However, I typed console.log(reverse(‘camila’)), which means I should get something like ‘alimac’ in return.
As you can see, there is nothing written.
Also, I just learned what jibo is all about, so I’m sorry it’s not related to that.

Thank you once again for your help.


#12

Per your code, that script should work just fine within an ExecuteScript or an ExecuteScriptAsync. What’s the error you’re receiving in the Jibo SDK?

By the way, what version of the SDK and Atom do you have installed? To find out, just go to Files > Settings > Packages and Help > About Atom, respectively.


#13

Michael, the issue isn’t related to Jibo SDK. It’s just running code on Javascript.


#14

Ah, thanks for the clarification. Well, in that case, your code does work fine as standard JavaScript if you run it in a web browser, but if you want to run it in Atom without using the Jibo SDK, you’ll need some sort of compiler. You can try the “build” Atom package which could work in your situation: https://atom.io/packages/build.


#15

Hi @mcamila11 thank you for checking out our forum. I’m curious to know how you stumbled here. If you have time please check out our SDK.

As @michael has said you’ll need some sort of compiler to run it.

Although you can also use something like https://jsbin.com to run your code too.

A good resource for general javascript/atom questions is http://stackoverflow.com/ where you can post questions and people will generally get back to you in a few minutes.

I hope this helps!


#16

Michael thank you so much for all your help. It is very much appreciated. I was finally able to make it work.


#17

Justin,

Thank you so much for joining the conversation.
So, I really like to click on everything whenever I am digging for answers. I just replied to the conversation hoping I would get help and not knowing what on earth Jibo was. It is a robot that I can create code for! How amazing!
God bless you for sharing those resources with me. They are very much needed and quite valuable.

Have a great one!


#18

Hey Justin, I think I know the entry point…if you search for “console log atom” in Google, this page comes up in the first 10 results.


#19

Oh wow! that’s pretty cool. I didn’t realize that this page is SEOed. :slight_smile: