__init__.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:kingpin 作者: pinterest 项目源码 文件源码
def __get_file_formatter():
    """Get logging formatter with Google logging like format.

    Each line in the log should look like:
    [DIWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] <message>

    Returns:
        Formatter object for use in logging handlers.
    """
    # [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] <message>
    ASCII_TIME_FORMAT = "%m%d %H:%M:%S"         # mmdd hh:mm:ss.uuuuuu
    LINE_FORMAT = ("%(levelname).1s"            # [DIWEF]
                   "%(asctime)s.%(msecs)s "     # ASCII_TIME_FORMAT
                   "%(threadName)s "            # threadid
                   "%(pathname)s:%(lineno)d] "  # file:line]
                   "%(message)s")               # <message>
    return logging.Formatter(fmt=LINE_FORMAT, datefmt=ASCII_TIME_FORMAT)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号