(taskid)
return jsonize({"success": True, "log": json_log_messages})
Retrieve the log messages
Retrieve the log messages
Retrieve the log messages
def scan_log(taskid):
    """
    Retrieve the log messages
    """
    json_log_messages = list()

    if taskid not in DataStore.tasks:
        logger.warning("[%s] Invalid task ID provided to scan_log()" % taskid)
        return jsonize({"success": False, "message": "Invalid task ID"})

    # Read all log messages from the IPC database
    for time_, level, message in DataStore.current_db.execute(
            "SELECT time, level, message FROM logs WHERE taskid = ? ORDER BY id ASC", (taskid,)):
        json_log_messages.append({"time": time_, "level": level, "message": message})

    logger.debug("[%s] Retrieved scan log messages" % taskid)
    return jsonize({"success": True, "log": json_log_messages})
def scan_log ( taskid ) : json_log_messages = list ( ) if taskid not in DataStore . tasks : logger . warning ( "[%s] Invalid task ID provided to scan_log()" % taskid ) return jsonize ( { "success" : False , "message" : "Invalid task ID" } ) # Read all log messages from the IPC database for time_ , level , message in DataStore . current_db . execute ( "SELECT time, level, message FROM logs WHERE taskid = ? ORDER BY id ASC" , ( taskid , ) ) : json_log_messages . append ( { "time" : time_ , "level" : level , "message" : message } ) logger . debug ( "[%s] Retrieved scan log messages" % taskid ) return jsonize ( { "success" : True , "log" : json_log_messages } )