【发布时间】:2015-01-20 03:11:13
【问题描述】:
当像这样在 python 中使用登录时
import logging
logging.basicConfig(level=logging.INFO)
logger = None
if <some condition>:
logger = logging.getLogger(__name__)
... some code ...
logger.debug('message')
如果没有if 语句不存在,是否可以避免调用logger.debug?
【问题讨论】: