NRAO Home > CASA > CASA Cookbook and User Reference Manual
1.5.2.2 Setting priority levels in the logger

Logger messages are assigned a Priority Level when generated within CASA. The current levels of Priority are:

  1. SEVERE — errors;
  2. WARN — warnings;
  3. INFO — basic information every user should be aware of or has requested;
  4. INFO1 — information possibly helpful to the user;
  5. INFO2 — details the power user might want to see;
  6. INFO3 — even more details;
  7. INFO4 — lowest level of non-debugging information;
  8. DEBUGGING — most “important” debugging messages;
  9. DEBUG1 — more details;
  10. DEBUG2 — lowest level of debugging messages.

The “debugging” levels are intended for the developers use.

Inside the Toolkit:
The casalog tool can be used to control the logging. In particular, the casalog.filter method sets the priority threshold. This tool can also be used to change the output log file, and to post messages into the logger.

There is a threshold for which these messages are written to the casapy-YYYYMMDD-HHMMSS.log file and are thus visible in the logger. By default, only messages at level INFO and above are logged. The user can change the threshold using the casalog.filter method. This takes a single string argument of the level for the threshold. The level sets the lowest priority that will be generated, and all messages of this level or higher will go into the casapy-YYYYMMDD-HHMMSS.log file.

Some examples:

   casalog.filter(’INFO’)           # the default  
   casalog.filter(’INFO2’)          # should satisfy even advanced users  
   casalog.filter(’INFO4’)          # all INFOx messages  
   casalog.filter(’DEBUG2’)         # all messages including debugging

WARNING: Setting the threshold to DEBUG2 will put lots of messages in the log!


More information about CASA may be found at the CASA web page

Copyright © 2010 Associated Universities Inc., Washington, D.C.

This code is available under the terms of the GNU General Public Lincense


Home | Contact Us | Directories | Site Map | Help | Privacy Policy | Search