User guide
5 Message Logging
Error, warning, and informational messages are logged in Katana using the logging module of the Python Standard
Library. Messages are logged from contexts including the Python tab, shelf scripts, and Python startup scripts.
NOTE: More information on logger objects in Python is available in the Python documentation.
You can filter the level of messages generated, and the level of messages displayed. For more on how to filter the
level of messages generated see the Installation and Licensing > Configuring Message Level section in the
Katana User Guide. For more on displaying messages and filtering the level of messages displayed, see the
Customizing Your Workspace > Message Center section in the Katana User Guide.
Message Levels
Katana recognizes the following standard log message levels from the Python logging module:
• info
• warning
• error
• critical
• debug
Loggers
There are two ways of logging messages from a Python context:
• directly through the Root Logger, or
• through a Custom Logger.
Root Logger
The following example logs a message of each supported type through Python's root logger:
import logging
logging.info("This is an informational message.")
logging.warning("This is a warning message.")
logging.error("This is an error message.")
logging.critical("This is a fatal error message.")