compass.utilities.logs.LocationFilter#
- class LocationFilter(location)[source]#
Bases:
Filter
Filter down to logs for a specific location
- Parameters:
location (
str
) – Location identifier. For example,"El Paso Colorado"
.
Methods
filter
(record)Filter logging record
- filter(record)[source]#
Filter logging record
- Parameters:
record (
logging.LogRecord
) – Log record containing the log message + default attributes. Must have alocation
attribute that is a string identifier, or this function will returnFalse
every time. Thelocation
identifier will be checked against the filter’s location attribute to determine the output result.- Returns:
bool
– If the record’slocation
attribute matches the filter’slocation
attribute.