def readJSONlog(logfile,filterfunction = (lambda x: True),customjson = None):
    """Iterate through a log file of JSON records and return a list of JSON records that meet the filterfunction.
    
    Args:
        logfile          : A file like object consisting of JSON records.
        filterfunction   : A function that returns True if the JSON record should be included in the output and False otherwise.
        customjson       : A decoder function to enable the loading of custom json objects
    Returns:
        A list of Python objects built from JSON records that passed the filterfunction.
    """
    JSONrecords = []
    for x in logfile:
        #if the record in the logfile returns true from the filter function convert it to JSON and add it the records to return
        rec = loads(x[:-1],object_hook = customjson)
        if filterfunction(rec): JSONrecords.append(rec)
    return JSONrecords
Iterate through a log file of JSON records and return a list of JSON records that meet the filterfunction.
    
    Args:
        logfile          : A file like object consisting of JSON records.
        filterfunction   : A function that returns True if the JSON record should be included in the output and False otherwise.
        customjson       : A decoder function to enable the loading of custom json objects
    Returns:
        A list of Python objects built from JSON records that passed the filterfunction.
    
recipes/Python/580667_JSON_Formatted_Logging/recipe-580667.py