小编Yog*_*esh的帖子

AttributeError:“Logger”对象没有属性“FileHandler”

我正在尝试将 FileHandler 添加到脚本中的记录器对象:

FOO_LOGGER = logging.getLogger(LOGGER_NAME)

# create the logging file handler
fh = FOO_LOGGER.FileHandler('foo.log')
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

AttributeError:“Logger”对象没有属性“FileHandler”

我使用的是Python版本Python 2.7.6

python python-2.7

1
推荐指数
1
解决办法
2万
查看次数

标签 统计

python ×1

python-2.7 ×1