forked from CJackHwang/AIstudioProxyAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogging_utils.py
More file actions
43 lines (36 loc) · 1.34 KB
/
logging_utils.py
File metadata and controls
43 lines (36 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""
Backward Compatibility Layer for logging_utils
This module provides backward compatibility for the original logging_utils package.
All functionality is now available through the new aistudio_proxy.utils package.
DEPRECATED: This module is provided for backward compatibility only.
Please update your imports to use: from aistudio_proxy.utils import ...
"""
import warnings
import sys
from pathlib import Path
# Add the new package to the path
sys.path.insert(0, str(Path(__file__).parent))
# Issue deprecation warning
warnings.warn(
"Importing from 'logging_utils' is deprecated. "
"Please use 'from aistudio_proxy.utils import ...' instead.",
DeprecationWarning,
stacklevel=2
)
# Import everything from the new location for backward compatibility
try:
from aistudio_proxy.utils import *
except ImportError:
# Fallback to original location if new structure not available
import sys
import os
# Add original logging_utils to path
original_path = os.path.join(os.path.dirname(__file__), 'logging_utils')
if os.path.exists(original_path):
sys.path.insert(0, original_path)
from logging_utils import *
else:
raise ImportError(
"Could not import from either new (aistudio_proxy.utils) or "
"original (logging_utils) location. Please check your installation."
)