推荐学习书目
› 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
kayanoa1
V2EX  ›  Python

logging 输出日志怎样对文件过滤

  •  
  •   kayanoa1 · Nov 7, 2022 · 2641 views
    This topic created in 1469 days ago, the information mentioned may be changed or developed.

    举例:有两个文件 a.py 和 b.py a 会调用 b 中的方法并输出很冗长的日志。 需求:对日志输出的文件名进行过滤,如果文件名为 b ,则不输出日志。 希望得到大佬的指教

    3 replies  •  2022-11-07 14:47:10 +08:00
    maybedk
    maybedk
    Nov 7, 2022
    1
    在 python 中如何只记录目标文件输出的日志_芳樽里的歌的博客-CSDN 博客
    https://blog.csdn.net/SunJW_2017/article/details/120241354
    kayanoa1
    kayanoa1
    OP
    Nov 7, 2022
    2
    @maybedk 好的。感谢。这个 bolg 我也有搜到过。找到项目中所有的 py 文件感觉应该会增加脚本耗时。我两个对比一下。
    julyclyde
    julyclyde
    Nov 7, 2022
    3
    @kayanoa1 不需要改所有的吧
    从程序入口开始改一下就是可以的吧?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   942 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 19:10 · PVG 03:10 · LAX 11:10 · JFK 14:10
    ♥ Do have faith in what you're doing.