当前位置: 首页>>代码示例>>Python>>正文


Python tornado.log方法代码示例

本文整理汇总了Python中tornado.log方法的典型用法代码示例。如果您正苦于以下问题:Python tornado.log方法的具体用法?Python tornado.log怎么用?Python tornado.log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tornado的用法示例。


在下文中一共展示了tornado.log方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setup_file_loggers

# 需要导入模块: import tornado [as 别名]
# 或者: from tornado import log [as 别名]
def setup_file_loggers(log_level: str):  # pragma: no cover
    """Handles application, Tornado, and SQLAlchemy logging configuration."""
    os.makedirs('log', exist_ok=True)
    timed_handler = logging.handlers.TimedRotatingFileHandler
    root_logger = logging.getLogger()
    root_logger.removeHandler(root_logger.handlers[0])
    logging.basicConfig(
        format='%(asctime)s %(levelname)s %(message)s',
        handlers=[timed_handler('log/dokomoforms.log', when='D')]
    )
    for log in ('access', 'application', 'general'):
        logger = logging.getLogger('tornado.{}'.format(log))
        handler = timed_handler('log/tornado.{}.log'.format(log), when='D')
        formatter = tornado.log.LogFormatter(color=False, datefmt=None)
        handler.setFormatter(formatter)
        logger.addHandler(handler)
    sql_logger = logging.getLogger('sqlalchemy')
    sql_logger.propagate = False
    sql_logger.setLevel(log_level)
    sql_handler = timed_handler('log/sqlalchemy.log', when='D')
    sql_handler.setLevel(log_level)
    sql_handler.setFormatter(logging.Formatter(
        '%(asctime)s %(levelname)s %(name)s %(message)s'
    ))
    sql_logger.addHandler(sql_handler) 
开发者ID:SEL-Columbia,项目名称:dokomoforms,代码行数:27,代码来源:webapp.py

示例2: login_available

# 需要导入模块: import tornado [as 别名]
# 或者: from tornado import log [as 别名]
def login_available(self):
        """May a user proceed to log in?

        This returns True if login capability is available, irrespective of
        whether the user is already logged in or not.

        """
        return bool(self.settings.get('password', '')) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:10,代码来源:handlers.py

示例3: log

# 需要导入模块: import tornado [as 别名]
# 或者: from tornado import log [as 别名]
def log(self):
        """use the IPython log by default, falling back on tornado's logger"""
        if Application.initialized():
            return Application.instance().log
        else:
            return app_log 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:8,代码来源:handlers.py

示例4: init_pycurl

# 需要导入模块: import tornado [as 别名]
# 或者: from tornado import log [as 别名]
def init_pycurl(self):
        try:
            AsyncHTTPClient.configure("tornado.curl_httpclient.CurlAsyncHTTPClient")
        except ImportError as e:
            self.log.debug("Could not load pycurl: %s\npycurl is recommended if you have a large number of users.", e)
        # set max verbosity of curl_httpclient at INFO
        # because debug-logging from curl_httpclient
        # includes every full request and response
        if self.log_level < logging.INFO:
            curl_log = logging.getLogger('tornado.curl_httpclient')
            curl_log.setLevel(logging.INFO) 
开发者ID:jupyterhub,项目名称:binderhub,代码行数:13,代码来源:app.py

示例5: start

# 需要导入模块: import tornado [as 别名]
# 或者: from tornado import log [as 别名]
def start(self, run_loop=True):
        self.log.info("BinderHub starting on port %i", self.port)
        self.http_server = HTTPServer(
            self.tornado_app,
            xheaders=True,
        )
        self.http_server.listen(self.port)
        if self.builder_required:
            asyncio.ensure_future(self.watch_build_pods())
        if run_loop:
            tornado.ioloop.IOLoop.current().start() 
开发者ID:jupyterhub,项目名称:binderhub,代码行数:13,代码来源:app.py


注:本文中的tornado.log方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。