pcdsutils.log.PydmDemotionFilter
- class pcdsutils.log.PydmDemotionFilter(level: str | int = 10, only_duplicates: bool = True)[source]
Demote verbose logs from pydm, particulary those that come at exit.
Currently, this demotes the “Unable to remove connection” logger exit spam from “ERROR” to “DEBUG”.
These can be caused by some poorly understood race conditions at program close and are not useful for the end user.
Methods
filter(record)Demote the log message if appropriate, return True to let it pass.
install([level, only_duplicates, logger])Create and apply the DemotionFilter to a specific logger, or the default logger.
install_self([logger])Convenience method for adding this filter to a logger.
record_dataclassalias of
RecordInfoshould_demote(record, info)Return True if we should demote the record, False otherwise.
uninstall()Convenience method for removing this filter.
reset_counter
- __init__(level: str | int = 10, only_duplicates: bool = True)
Initialize a filter.
Initialize with the name of the logger which, together with its children, will have its events allowed through the filter. If no name is specified, allow every event.
Methods
__init__([level, only_duplicates])Initialize a filter.
filter(record)Demote the log message if appropriate, return True to let it pass.
install([level, only_duplicates, logger])Create and apply the DemotionFilter to a specific logger, or the default logger.
install_self([logger])Convenience method for adding this filter to a logger.
reset_counter()should_demote(record, info)Return True if we should demote the record, False otherwise.
uninstall()Convenience method for removing this filter.
Attributes
default_loggerlevelnolevelnameonly_duplicatescachecounter