V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
? Learn Python the Hard Way
Python Sites
? PyPI - Python Package Index
? http://diveintopython.org/toc/index.html
? Pocoo
值得关注的项目
? PyPy
? Celery
? Jinja2
? Read the Docs
? gevent
? pyenv
? virtualenv
? Stackless Python
? Beautiful Soup
? 结巴中文分词
? Green Unicorn
? Sentry
? Shovel
? Pyflakes
? pytest
Python 编程
? pep8 Checker
Styles
? PEP 8
? Google Python Style Guide
? Code Style from The Hitchhiker's Guide
chaleaoch
V2EX  ?  Python

py 文件编译成.so 文件之后, logging 无法获取当前具体是哪个文件的哪行代码了.

  •  
  •   chaleaoch · 2021-01-14 21:41:20 +08:00 · 1614 次点击
    这是一个创建于 1206 天前的主题,其中的信息可能已经有所发展或是发生改变。
    可解否?
    5 条回复  ?  2021-01-15 12:42:38 +08:00
    yangyaofei
        1
    yangyaofei  
       2021-01-15 09:58:31 +08:00   ?? 1
    我记得是 Cython 编译之后是有一个变量不能用(就是没了)的. 比如 __file__, 我觉得原因就在此,我觉得无所谓吧,logging 的时候信息再多点不知道那个文件知道哪个类不是一样?
    black11black
        2
    black11black  
       2021-01-15 11:43:35 +08:00   ?? 1
    印象中 cython 可以设置允许或关闭 traceback,默认是允许的,理论上与原生无异。LZ 嵌入了一些反向追踪的内容?
    julyclyde
        3
    julyclyde  
       2021-01-15 11:52:10 +08:00
    哪种编译方法呢?
    chaleaoch
        4
    chaleaoch  
    OP
       2021-01-15 11:57:16 +08:00
    @julyclyde cython
    chaleaoch
        5
    chaleaoch  
    OP
       2021-01-15 12:42:38 +08:00   ?? 1
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   899 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 23:27 · PVG 07:27 · LAX 16:27 · JFK 19:27
    Developed with CodeLauncher
    ? Do have faith in what you're doing.


    http://www.vxiaotou.com