在Ipython Notebook中禁用INFO日志记录消息 [英] Disable INFO logging messages in Ipython Notebook

查看:88
本文介绍了在Ipython Notebook中禁用INFO日志记录消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用request_throttler并请求通过API进行通信的模块.我的脚本是用Ipython Notebook写的.我从requests_throttler模块中获取了很多日志消息. 如何在Ipython Notebook中禁用或保存到文件日志消息?我收到类似这样的消息:

I'm using requests_throttler and requests modules for communication through API. My script are writen in Ipython Notebook. I'm getting a lot of logging messages from requests_throttler module. How may I disable or save to file log messages in Ipython Notebook? I got message like:

INFO:requests_throttler.throttler:Starting base throttler 'base-throttler'...

,并希望发送数千个请求,并且此INFO消息将杀死我的笔记本.

and want to send thousands of requests and this INFO messages will kill my notebook.

推荐答案

如果您只想禁用Jupyter Notebook中的所有INFO日志记录,请在笔记本中执行以下操作:

If you just want to disable all INFO loggings in Jupyter Notebook just do the following inside your notebook:

#Supress default INFO logging

import logging
logger = logging.getLogger()
logger.setLevel(logging.CRITICAL)

这篇关于在Ipython Notebook中禁用INFO日志记录消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆