当前位置:首页>python>Python学习--sys.exc_info() 方法详解

Python学习--sys.exc_info() 方法详解

  • 2026-06-29 12:55:29
Python学习--sys.exc_info() 方法详解

一、什么是 sys.exc_info()?

sys.exc_info() 是 Python 标准库 sys 模块中的一个函数,用于获取当前正在处理的异常信息。它返回一个包含三个元素的元组,提供关于当前异常的详细信息。

二、exc_info() 的基本用法

1. 返回值结构

import sysdef basic_exc_info():    """exc_info() 的基本用法"""    try:        # 引发一个异常        1 / 0    except Exception as e:        # 获取异常信息        exc_type, exc_value, exc_traceback = sys.exc_info()        print(f"异常类型: {exc_type}")        print(f"异常值: {exc_value}")        print(f"异常类型名称: {exc_type.__name__}")        print(f"异常信息: {exc_value}")        print(f"回溯对象: {exc_traceback}")basic_exc_info()

2. exc_info() 的三个返回值

import sysimport tracebackdef three_return_values():    """exc_info() 的三个返回值详解"""    try:        # 引发复杂异常        raise ValueError("这是一个值错误"100, {"detail""额外信息"})    except Exception:        exc_type, exc_value, exc_traceback = sys.exc_info()        print("=== 异常类型 (exc_type) ===")        print(f"类型: {exc_type}")        print(f"类型名称: {exc_type.__name__}")        print(f"类型模块: {exc_type.__module__}")        print("\n=== 异常值 (exc_value) ===")        print(f"值: {exc_value}")        print(f"参数: {exc_value.args}")        print(f"字符串表示: {str(exc_value)}")        print("\n=== 回溯对象 (exc_traceback) ===")        print(f"回溯对象: {exc_traceback}")        # 使用 traceback 模块格式化回溯信息        print("\n=== 格式化回溯 ===")        tb_lines = traceback.format_tb(exc_traceback)        for line in tb_lines:            print(line, end='')three_return_values()

三、在不同场景中使用 exc_info()

1. 在异常处理中获取详细信息

import sysimport tracebackdef detailed_exception_info():    """获取详细的异常信息"""    def process_data(data):        """处理数据的函数"""        if not data:            raise ValueError("数据不能为空")        if not isinstance(data, list):            raise TypeError(f"数据必须是列表,得到 {type(data).__name__}")        if len(data) < 3:            raise IndexError(f"数据长度不足,需要至少3个元素,当前: {len(data)}")        return sum(data) / len(data)    try:        # 调用可能出错的函数        result = process_data([12])        print(f"结果: {result}")    except Exception:        # 获取完整的异常信息        exc_type, exc_value, exc_tb = sys.exc_info()        print("=" * 50)        print("异常详细信息:")        print("=" * 50)        # 基本信息        print(f"异常类型: {exc_type.__name__}")        print(f"异常信息: {exc_value}")        print(f"异常模块: {exc_type.__module__}")        # 异常参数        if exc_value.args:            print(f"异常参数: {exc_value.args}")        # 获取文件名和行号        tb = exc_tb        while tb:            filename = tb.tb_frame.f_code.co_filename            line_number = tb.tb_lineno            function_name = tb.tb_frame.f_code.co_name            print(f"\n位置: {filename}")            print(f"行号: {line_number}")            print(f"函数: {function_name}")            tb = tb.tb_next        # 完整的堆栈跟踪        print("\n完整堆栈跟踪:")        traceback.print_tb(exc_tb)detailed_exception_info()

2. 日志记录中的使用

import sysimport loggingimport tracebackfrom datetime import datetimedef logging_with_exc_info():    """在日志记录中使用 exc_info()"""    # 配置日志    logging.basicConfig(        level=logging.ERROR,        format='%(asctime)s - %(levelname)s - %(message)s',        handlers=[            logging.FileHandler('error.log'),            logging.StreamHandler()        ]    )    def log_exception_decorator(func):        """记录异常的装饰器"""        def wrapper(*args, **kwargs):            try:                return func(*args, **kwargs)            except Exception:                exc_type, exc_value, exc_tb = sys.exc_info()                # 记录详细的异常信息                logging.error(                    f"函数 {func.__name__} 发生异常\n"                    f"类型: {exc_type.__name__}\n"                    f"信息: {exc_value}\n"                    f"位置: {exc_tb.tb_frame.f_code.co_filename}:{exc_tb.tb_lineno}"                )                # 也可以记录完整的堆栈跟踪                # logging.exception("发生异常")  # 自动包含堆栈                raise  # 重新抛出异常        return wrapper    @log_exception_decorator    def risky_operation():        """可能失败的操作"""        return 10 / 0    try:        risky_operation()    except ZeroDivisionError:        print("捕获到除零错误")# logging_with_exc_info()

3. 异常重新包装

import sysdef exception_wrapping():    """使用 exc_info() 重新包装异常"""    class AppError(Exception):        """应用错误基类"""        pass    class DatabaseError(AppError):        """数据库错误"""        pass    def db_operation():        """数据库操作"""        # 模拟数据库错误        raise ConnectionError("无法连接到数据库服务器")    def process_request():        """处理请求"""        try:            db_operation()        except ConnectionError:            # 获取原始异常信息            exc_type, exc_value, exc_tb = sys.exc_info()            # 重新包装为应用异常            new_exc = DatabaseError(f"数据库操作失败: {exc_value}")            # 保留原始异常信息            new_exc.__cause__ = exc_value            new_exc.original_type = exc_type            new_exc.original_traceback = exc_tb            raise new_exc    try:        process_request()    except DatabaseError as e:        print(f"捕获到应用错误: {e}")        print(f"原始异常: {e.__cause__}")        print(f"原始类型: {e.original_type.__name__}")exception_wrapping()

四、exc_info() 的高级用法

1. 自定义异常上下文管理器

import sysimport tracebackfrom contextlib import contextmanagerdef custom_exception_context():    """自定义异常上下文管理器"""    class ExceptionContext:        """异常上下文"""        def __init__(self):            self.exc_type = None            self.exc_value = None            self.exc_traceback = None            self.handled = False        def __enter__(self):            return self        def __exit__(self, exc_type, exc_val, exc_tb):            if exc_type:                self.exc_type = exc_type                self.exc_value = exc_val                self.exc_traceback = exc_tb                self.handled = True            return self.handled    @contextmanager    def capture_exception():        """捕获异常的上下文管理器"""        try:            yield        except Exception:            exc_type, exc_value, exc_tb = sys.exc_info()            print(f"捕获到异常: {exc_type.__name__}{exc_value}")            print("异常已被上下文管理器捕获")            # 不重新抛出,异常被抑制    # 使用自定义上下文    print("=== 使用 ExceptionContext ===")    with ExceptionContext() as ctx:        result = 10 / 0    if ctx.exc_type:        print(f"捕获到异常: {ctx.exc_type.__name__}")        print(f"异常信息: {ctx.exc_value}")    # 使用上下文管理器捕获异常    print("\n=== 使用 capture_exception ===")    with capture_exception():        result = 10 / 0        print("这行不会执行")    print("程序继续执行")custom_exception_context()

2. 异常过滤和分类

import sysimport timedef exception_filtering():    """异常过滤和分类"""    class ExceptionClassifier:        """异常分类器"""        @staticmethod        def classify():            """分类当前异常"""            exc_type, exc_value, exc_tb = sys.exc_info()            if exc_type is None:                return "无异常"            # 根据异常类型分类            if issubclass(exc_type, ValueError):                return "值错误"            elif issubclass(exc_type, TypeError):                return "类型错误"            elif issubclass(exc_type, (IOError, OSError)):                return "IO错误"            elif issubclass(exc_type, (ConnectionError, TimeoutError)):                return "网络错误"            else:                return "其他错误"        @staticmethod        def get_severity():            """获取异常严重程度"""            exc_type, exc_value, exc_tb = sys.exc_info()            if exc_type is None:                return "none"            # 根据异常类型判断严重程度            critical_exceptions = (MemoryError, SystemError, KeyboardInterrupt)            error_exceptions = (ValueError, TypeError, KeyError, IndexError)            warning_exceptions = (UserWarning, DeprecationWarning)            if issubclass(exc_type, critical_exceptions):                return "critical"            elif issubclass(exc_type, error_exceptions):                return "error"            elif issubclass(exc_type, warning_exceptions):                return "warning"            else:                return "info"    def test_exceptions():        """测试各种异常"""        exceptions = [            (ValueError, "值错误测试"),            (TypeError, "类型错误测试"),            (KeyError, "键错误测试"),            (ConnectionError, "连接错误测试"),        ]        for exc_class, msg in exceptions:            try:                raise exc_class(msg)            except Exception:                category = ExceptionClassifier.classify()                severity = ExceptionClassifier.get_severity()                print(f"{exc_class.__name__}: 分类={category}, 严重程度={severity}")    test_exceptions()exception_filtering()

3. 异常监控和统计

import sysimport timeimport threadingfrom collections import defaultdictdef exception_monitoring():    """异常监控和统计"""    class ExceptionMonitor:        """异常监控器"""        def __init__(self):            self.stats = defaultdict(lambda: {                'count'0,                'last_occurrence'None,                'messages': [],                'locations'set()            })            self.lock = threading.Lock()        def record(self):            """记录当前异常"""            exc_type, exc_value, exc_tb = sys.exc_info()            if exc_type is None:                return            with self.lock:                key = exc_type.__name__                self.stats[key]['count'] += 1                self.stats[key]['last_occurrence'] = time.time()                # 记录错误信息(最多10条)                msg = str(exc_value)                if len(self.stats[key]['messages']) < 10:                    self.stats[key]['messages'].append(msg)                # 记录位置                if exc_tb:                    filename = exc_tb.tb_frame.f_code.co_filename                    lineno = exc_tb.tb_lineno                    self.stats[key]['locations'].add(f"{filename}:{lineno}")        def get_report(self):            """获取统计报告"""            report = {}            with self.lock:                for name, data in self.stats.items():                    report[name] = {                        'count': data['count'],                        'last_occurrence': time.ctime(data['last_occurrence']) if data['last_occurrence'else None,                        'sample_messages': data['messages'][:5],                        'locations'list(data['locations'])                    }            return report        def reset(self):            """重置统计"""            with self.lock:                self.stats.clear()    # 装饰器版本    def monitored(func):        """监控装饰器"""        def wrapper(*args, **kwargs):            monitor = ExceptionMonitor()            try:                return func(*args, **kwargs)            except Exception:                monitor.record()                raise        return wrapper    # 使用监控器    monitor = ExceptionMonitor()    def test_operations():        """测试操作"""        operations = [            lambda1 / 0,            lambdaint("abc"),            lambda: [1,2,3][10],            lambda: {}['key'],            lambda1 / 0,  # 重复异常        ]        for op in operations:            try:                op()            except Exception:                monitor.record()        # 打印报告        print("异常统计报告:")        for name, data in monitor.get_report().items():            print(f"\n{name}:")            print(f"  发生次数: {data['count']}")            print(f"  最后发生: {data['last_occurrence']}")            print(f"  错误消息示例: {data['sample_messages'][:2]}")            print(f"  发生位置: {data['locations']}")    test_operations()exception_monitoring()

五、exc_info() 的注意事项

1. 生命周期和循环引用

import sysimport gcdef lifecycle_notes():    """exc_info() 的生命周期注意事项"""    # 注意:exc_info() 返回的回溯对象可能包含循环引用    def memory_issue():        """可能导致内存泄漏的示例"""        try:            raise ValueError("测试错误")        except Exception:            exc_type, exc_value, exc_tb = sys.exc_info()            # exc_tb 包含对当前帧的引用            # 如果存储了 exc_tb,可能导致循环引用            return exc_tb        # 更好的做法:使用 traceback 模块提取需要的信息        # 而不是保存整个回溯对象    def better_approach():        """更好的做法"""        try:            raise ValueError("测试错误")        except Exception:            import traceback            # 只保存格式化的信息,而不是回溯对象            tb_lines = traceback.format_exc()            return tb_lines    # 清理异常信息    def clear_exception():        """清理异常信息"""        try:            raise ValueError("测试")        except Exception:            exc_type, exc_value, exc_tb = sys.exc_info()            # 处理异常...            # 清理引用,帮助垃圾回收            del exc_type, exc_value, exc_tb    print("注意: exc_info() 返回的对象可能包含循环引用")    print("建议: 使用 traceback 模块提取信息而不是保存回溯对象")lifecycle_notes()

2. 线程安全

import sysimport threadingimport timedef thread_safety():    """exc_info() 的线程安全性"""    # exc_info() 是线程安全的,返回当前线程的异常信息    results = []    def worker(worker_id):        try:            # 每个线程有自己的异常信息            if worker_id % 2 == 0:                raise ValueError(f"线程 {worker_id} 的值错误")            else:                raise TypeError(f"线程 {worker_id} 的类型错误")        except Exception:            # 获取当前线程的异常信息            exc_type, exc_value, exc_tb = sys.exc_info()            results.append({                'thread': worker_id,                'type': exc_type.__name__,                'message'str(exc_value)            })    # 创建多个线程    threads = []    for i in range(5):        t = threading.Thread(target=worker, args=(i,))        threads.append(t)        t.start()    for t in threads:        t.join()    # 打印结果    for result in results:        print(f"线程 {result['thread']}{result['type']} - {result['message']}")thread_safety()

六、总结

sys.exc_info() 要点表格

  返回值
类型
说明
exc_type
type
异常类型(如 ValueError
 exc_value
Exception
异常实例
 exc_traceback
traceback
回溯对象

使用场景总结

 场景
用途
 日志记录
记录详细的异常信息
 异常包装
保留原始异常信息
 错误处理框架
统一的错误处理逻辑
 事务管理
判断事务是否需要回滚
 监控统计
统计异常发生情况
 调试工具
获取异常发生的详细信息

最佳实践

  1. 优先使用 traceback 模块

    • 使用 traceback.format_exc() 获取格式化的回溯

    • 避免直接保存 exc_traceback 对象

  2. 及时清理异常信息

    try:    # codeexcept Exception:    exc_type, exc_value, exc_tb = sys.exc_info()    # 处理异常    del exc_type, exc_value, exc_tb  # 帮助垃圾回收
  3. 线程安全

    • exc_info() 是线程安全的

    • 每个线程有独立的异常信息

  4. 在 except 块外使用

    • exc_info() 只在 except 块内有意义

    • 在 except 块外返回 (None, None, None)

sys.exc_info() 是 Python 中获取异常信息的强大工具,在日志记录、异常包装、错误处理框架等场景中非常有用。正确使用它可以帮助你构建更健壮、更易调试的应用程序。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-03 09:45:09 HTTP/2.0 GET : https://f.mffb.com.cn/a/489696.html
  2. 运行时间 : 0.165889s [ 吞吐率:6.03req/s ] 内存消耗:4,798.60kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=cfcf5e8c2646257dc21a5df6e5bc6ea7
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000591s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000792s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.006425s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.008838s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000629s ]
  6. SELECT * FROM `set` [ RunTime:0.004662s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000780s ]
  8. SELECT * FROM `article` WHERE `id` = 489696 LIMIT 1 [ RunTime:0.019432s ]
  9. UPDATE `article` SET `lasttime` = 1783043110 WHERE `id` = 489696 [ RunTime:0.018238s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.010573s ]
  11. SELECT * FROM `article` WHERE `id` < 489696 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001056s ]
  12. SELECT * FROM `article` WHERE `id` > 489696 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001534s ]
  13. SELECT * FROM `article` WHERE `id` < 489696 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.001101s ]
  14. SELECT * FROM `article` WHERE `id` < 489696 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.007971s ]
  15. SELECT * FROM `article` WHERE `id` < 489696 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.013746s ]
0.167456s