| 123456789101112131415 | # -*- coding: utf-8 -*-#!/usr/bin/env pythonimport threadingfrom uuid import uuid4local = threading.local()def generate_request_id():    return str(uuid4())def get_current_request_id():    return getattr(local, 'request_id', generate_request_id())
 |