Debugging Your Code

Introduction

When you're writing Jython or Java code for Wyvern, you'll find that it often doesn't work exactly you expect on the first try. It helps to be able to see what's going on in the code.

Wyvern provides logging to help you do your debugging. The basic idea behind logging is this:

  • You put log messages into your code at various points.

  • While you're debugging, you can have the log messages printed out — either to a file, or to your wiz console.

  • When you're done debugging, you leave the log messages in your code, but they don't get executed.

Once you finish writing a piece of code, you don't need to see most of the log messages anymore. However, sometimes you'll find that there's a bug in your code weeks or months later. All you have to do is turn debugging back on for that code, and you'll be able to find the problem easily, since the logging statements are all still there.

This tutorial will cover how to use logging in your code, and how to debug with it.

Next Chapter >>