structured_logging.py 文件源码

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

项目:seqlog 作者: tintoy 项目源码 文件源码
def _get_local_timestamp(record):
    """
    Get the record's UTC timestamp as an ISO-formatted date / time string.

    :param record: The LogRecord.
    :type record: StructuredLogRecord
    :return: The ISO-formatted date / time string.
    :rtype: str
    """

    timestamp = datetime.fromtimestamp(
        timestamp=record.created,
        tz=tzlocal()
    )

    return timestamp.isoformat(sep=' ')
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号