Todo

  • Insert todo’s here

API documentation

This section details the public API for configuring application logging across the SKA project.

Python

The API for the configuration using Python is shown below.

Public API Documentation

Functions

Module init code.

ska_ser_logging.configure_logging(level=None, tags_filter=None, overrides=None)[source]

Configure Python logging for SKA applications.

This function should be used to configure the application’s logging system as early as possible at start up.

Note

For Python TANGO devices that inherit from lmcbaseclasses.SKABaseDevice this is already done in that base class, so it does not need to be done again.

Example usage is shown in this repo’s README.md file.

Parameters
  • level (str or int, optional) – Set the logging level to this instead of the default. Use the string representations like “”INFO” and “DEBUG”, or integer values like logging.INFO and logging.DEBUG.

  • tags_filter (type derived from logging.Filter, optional) – If this type (not instance) is provided, the default formatter will include a “%(tags)s” specifier. The filter must inject the tags attribute in each record.

  • overrides (dict, optional) – The default logging configuration can be modified by passing in this dict. It will be recursively merged with the default. This allows existing values to be modified, or even removed. It also allows additional loggers, handlers, filters and formatters to be added. See the _override function for more details on the merging process. The end result must be compatible with the logging.config.dictConfig schema. Note that the level and tags_filter parameter are applied after merging the overrides.

ska_ser_logging.get_default_formatter(tags=False)[source]

Return a formatter configured with the standard logging format.

Parameters

tags (bool, optional) – If true, then include the “tags” field in the format string. This requires a tags filter to be linked to the corresponding handler.

Returns

A new default formatter.

Return type

logging.Formatter