The console is a very important part of the IDE to monitor what goes on in a running robot.

What shows up in the console

Compile-time errors do not go in the console. Runtime errors do, and also the function System.print outputs to it.

Log levels

All console entries have a level. There are four:

  1. error
  2. warning
  3. info
  4. debug

The function System.print can generate any level you want. When not specified, the default is 'info'. The screenshot above is generated with:

use System;
System.print("Hello World");

Now try the following code, that has an extra parameter:

use System;
System.print("This is a debugging entry","debug");
System.print("This is a warning","warning");

Runtime errors and -warnings are automatically printed with these levels, but now you've seen how to set up additional console messages like that. An example of an automatic error message can be seen by running the following code. 

use File;
var test = File.iterateFiles("/cddeffghhijjkllmnn");

Benefits of the difference in log levels

Select breaking log levels

In this little menu, you can select what level of log events will pause your robot when they happen. For a production run that takes a whole night, for instance, you will probably want to turn these all off. While debugging, you might want all of them activated, to be able to inspect variables in the debug panel immediately when something goes wrong.

Filtering console messages

Write the five lines of code that produce this output. Now you can test the filtering buttons yourself. Click one of them 'off' and the entries of that level will disappear. This way you can view the errors only, or just hide the debug entries.

Other console features

There are a few more buttons. They are for viewing console pages, clearing the console and searching. You can try them out by yourself. While searching, there are also options for case-sensitivity and regex.

One last tip: in the settings window, there are some console related settings that could be useful to you.