推荐学习书目
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 · 2406 views
    This topic created in 1327 days ago, the information mentioned may be changed or developed.

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

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