V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
GjriFeu
V2EX  ›  Python

Python logging 模块

  •  
  •   GjriFeu · Oct 11, 2017 · 1733 views
    This topic created in 3133 days ago, the information mentioned may be changed or developed.
    • 想在一个程序中使用多个 logger (一个是根 logger ),先设置了根 logger 的属性,然后子模块中设置了一个 logger ; 但是发现有一个问题是子 logger 写的日志也会写到根 logging 的文件中。

    有没有什么方法设置子模块的 logger 写的日志 不会写到根 logger 的文件中,请教各位大佬

    2 replies    2017-10-11 16:37:20 +08:00
    knightdf
        1
    knightdf  
       Oct 11, 2017   ❤️ 1
    set propagate = False
    GjriFeu
        2
    GjriFeu  
    OP
       Oct 11, 2017
    @knightdf 感激不尽
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   850 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 20:32 · PVG 04:32 · LAX 13:32 · JFK 16:32
    ♥ Do have faith in what you're doing.