13 lines
326 B
Python
13 lines
326 B
Python
import functools
|
|
|
|
from mower.utils.log import logger
|
|
from mower.utils.traceback import caller_info
|
|
|
|
|
|
def deprecated(func):
|
|
@functools.wraps(func)
|
|
def new_func(*args, **kwargs):
|
|
logger.warning(f"弃用函数 {func.__name__} 被 {caller_info()} 调用")
|
|
return func(*args, **kwargs)
|
|
|
|
return new_func
|