Debugging in Sunflower Console

In addition to the margin error reporting feature and the Problems tab discussed in section Syntax Error Reporting, there is also the Sunflower Console plugin which displays helpful information for debugging. All warnings and errors from Flora are output to this window.

The Sunflower Console uses the currently active file as its context, and queries can be interactively typed into its window to obtain answers. Problems are not necessarily reported at the bottom of the output window, however. So one needs to search for both “Error” and “Warning” in the window in order to locate the detected problems. One example of this is a file loading error that happens in the beginning of a query execution. Suppose an imported file cannot be found, the loading error can appear in Sunflower Console near the beginning of the list of display messages, as shown in Fig. 143.

Imported file not found is reported in **Sunflower Console**

Fig. 143 Imported file not found is reported in Sunflower Console

Also, it can happen that nothing is shown in the console with a query execution. For example, if a query had been run previously and therefore the answers to the query are already loaded or tabled, executing the same query with nothing changed will not generate any display message in the Sunflower Console. In order to see potential errors and warnings in that situation, one can edit the current file in a minor way and save it, e.g. adding an empty line to the file. This will trigger a reloading of the current file and error reporting to the Sunflower Console.

Sometimes it helps to clear out old content of the console window and start afresh. The Clear Console icon, as shown in Fig. 144, can be used to remove all old display messages of the Sunflower Console.

The Clear Console Icon

Fig. 144 The Clear Console Icon

If you are a Sunflower developer, more in-depth diagnostics may be needed to debug problems with the system. The Sunflower error logging level which controls the level of diagnostics details displayed in Sunflower Console can be customized. Please see Sunflower Logging for more details.

For more diagnostics outputs, you can also try running Sunflower from the command line. On MacOS this can be done using ./SunflowerCore.app/Contents/MacOS/Sunflower Core from a terminal window. On Windows, call sunflower-studio-ce/external/flora2/runflora2.bat from a command tools window. On Linux, call sunflower-studio-ce/external/flora2/runflora2.sh from a shell window.