Adjusting Logging at Runtime

The logging level for the root logger of a component/device can be adjusted at runtime in the IDE. The following procedure explains how to adjust the logging level.

  1. Right-click the running component or device and select Logging > Log Level.

    The Set Debug Level dialog displays the current logging level:

    Set Debug Level
    Set Debug Level

  2. Select the new logging level you want to use and click OK.

    The new log level is used.

After a component or device has been launched, its logging configuration can also be dynamically modified.

  1. Right-click the running component or device and select Logging > Edit Log Config. If this is the first time you have used the editor, a warning is displayed.

  2. If a warning is displayed, click Yes. The Edit Log Config editor is displayed.

    Edit Log Config Editor
    Edit Log Config Editor

    The editor shows the resource’s logging configuration. Saving changes to the editor performs a live update of the resource’s logging configuration.

The logging API provides fine-grained access to the various loggers. The logging API can be used to retrieve a list of the resource’s loggers, change the logging level or configuration for any one specific logger, or determine the state of any one logger.

This API is available directly to the resources; one way of accessing this API is through the Python package.

Assuming that there is a reference to an instance of a component called comp_1 associated with variable c, the following Python examples can be exercised:

These commands are also available for the Domain Manager, Device Manager, and application objects. In the case of the Domain Manager and Device Manager, they affect the specific object. In the case of an application, the logging API aggregates all components’ loggers through a single interface. For example, calling getNamedLoggers on an application object returns a list of all the named loggers in all components in the application.