@app.route('/scans/<int:scan_id>/log', methods=['GET'])
@requires_auth
def scan_log(scan_id):
 scan_info = get_scan_info_from_id(scan_id)
 if (scan_info is None):
  abort(404, 'Scan not found')
 if (scan_info.output is None):
  abort(404, 'Scan output not found')
 page = request.args.get('page', None)
 _id = request.args.get('id', None)
 if ((page is not None) and (not page.isdigit())):
  abort(400, 'Invalid page number')
 if ((_id is not None) and (not _id.isdigit())):
  abort(400, 'Invalid log id')
 if ((page is not None) and (_id is not None)):
  abort(400, 'Can only paginate using one of "page" or "id"')
 (next, next_url, log_entries) = paginate_logs(scan_id, scan_info, page, _id)
 return jsonify({'next': next, 'next_url': next_url, 'entries': log_entries})

@ app . route ( '/scans/<int:scan_id>/log' , methods = [ 'GET' ] ) @ requires_auth def scan_log ( scan_id ) : scan_info = get_scan_info_from_id ( scan_id ) if ( scan_info is None ) : abort ( 404 , 'Scan not found' ) if ( scan_info . output is None ) : abort ( 404 , 'Scan output not found' ) page = request . args . get ( 'page' , None ) _id = request . args . get ( 'id' , None ) if ( ( page is not None ) and ( not page . isdigit ( ) ) ) : abort ( 400 , 'Invalid page number' ) if ( ( _id is not None ) and ( not _id . isdigit ( ) ) ) : abort ( 400 , 'Invalid log id' ) if ( ( page is not None ) and ( _id is not None ) ) : abort ( 400 , 'Can only paginate using one of "page" or "id"' ) ( next , next_url , log_entries ) = paginate_logs ( scan_id , scan_info , page , _id ) return jsonify ( { 'next' : next , 'next_url' : next_url , 'entries' : log_entries } )
retrieve the log messages .