Debugging Your Code

Controlling Logging Output

Every log message has an associated Log Level. There are seven predefined levels in Wyvern:

  • SEVERE
  • WARNING
  • INFO
  • CONFIG
  • FINE
  • FINER
  • FINEST

For each log level, there is a corresponding wyvern.lib.Kernel method for emitting a message at that level:

  • Kernel.severe()
  • Kernel.warning()
  • Kernel.info()
  • Kernel.config()
  • Kernel.fine()
  • Kernel.finer()
  • Kernel.finest()

SEVERE messages are the most important, and FINEST messages are the least important.

By default, Wyvern writes SEVERE, WARNING, and INFO messages to the system logs, so you should only use those levels for messages that indicate serious errors that someone should look into right away.

CONFIG, FINE, FINER, and FINEST messages are used for debugging. They aren't normally turned on, but you can enable them for a given debugging session to get detailed information about what's happening in your code.

If you turn on logging at a given level, you'll see all messages for that level and higher levels. For instance, if you set the log level to FINE, you'll see all messages for FINE, CONFIG, INFO, WARNING, and SEVERE.

<< Previous Chapter Next Chapter >>