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 a location attribute that is a string identifier, or this function will return False every time. The location identifier will be checked against the filter’s location attribute to determine the output result.

Returns:

bool – If the record’s location attribute matches the filter’s location attribute.