在我的Flask web应用程序中,我感兴趣的是将Superset -OAuthLib中的日志级别设置为DEBUG。我们可以看到Flask-OAuthLib从一个超集web应用程序访问它的记录器here on line 26。
超集是一个使用Flask-AppBuilder实现的web应用程序。它允许通过Flask-OAuthLib进行OAuth2身份验证。
我想从custom_sso_security_manager.py配置Flask-OAuthLib日志...用the Superset docs on custom OAuth configuration描述的一个模块。
发布于 2019-11-23 18:28:10
您可以以完全相同的方式访问记录器。它们被添加到全局字典中,可以使用getLogger(key)从全局字典中获取条目。因此,在导入oauth库之后,您所需要做的就是将如下内容放入文件中:
oauth_logger = logging.getLogger('flask_oauthlib')
oauth_logger.setLevel(logging.DEBUG)
# it is custom for libs to have no handler (except the NullHandler)
# so you may want to add one:
oauth_logger.addHandler(logging.StreamHandler()) # just an examplehttps://stackoverflow.com/questions/58999444
复制相似问题