관리-도구
편집 파일: sessions.cpython-38.pyc
U �Mg�# � @ s* d dl Z d dlZd dlZd dlmZmZ d dlmZ d dlZd dl m Z d dlmZ d dl mZ d dlmZ er�d dlmZ d d lmZ d d lmZ d dlmZ d dlmZ d d lmZ d dlmZ d"dd�Zed#dd��Zdd� Zdd� Zed$dd��Zed%dd��ZdZdZdd� Z G d d!� d!�Z!dS )&� N)�Thread�Lock)�contextmanager)�Envelope)�Session)�format_timestamp)� TYPE_CHECKING)�Any)�Callable)�Dict)� Generator)�List)�Optional)�Unionc C sR t jdtdd� | dkr tjj} | jj}|dkrN| jr>| jj ni }|� dd�}|S )zHDEPRECATED: Utility function to find out if session tracking is enabled.�nThis function is deprecated and will be removed in the next major release. There is no public API replacement.� �� stacklevelN�auto_session_trackingF)�warnings�warn�DeprecationWarning� sentry_sdk�Hub�current�scope�_force_auto_session_tracking�client�options�get)�hub�should_track�client_options� r# �A/opt/hc_python/lib/python3.8/site-packages/sentry_sdk/sessions.py� is_auto_session_tracking_enabled s �r% �applicationc c sv t jdtdd� | dkr tjj} t �� � t �dt� t| �}W 5 Q R X |rX| j |d� z dV W 5 |rp| � � X dS )zgDEPRECATED: Use track_session instead Starts and stops a session automatically around a block. zeThis function is deprecated and will be removed in the next major release. Use track_session instead.r r N�ignore��session_mode)r r r r r r �catch_warnings�simplefilterr% � start_session�end_session)r r) r! r# r# r$ r 0 s � r c C s t jdtdd� t| �S )zR DEPRECATED: Utility function to find out if session tracking is enabled. r r r )r r r �!_is_auto_session_tracking_enabled)r r# r# r$ �&is_auto_session_tracking_enabled_scopeK s �r/ c C s( | j }|dkr$t�� j}|�dd�}|S )zF Utility function to find out if session tracking is enabled. Nr F)r r Z get_clientr r )r r! r"