logging_utils.py 文件源码

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

项目:aws-encryption-sdk-cli 作者: awslabs 项目源码 文件源码
def __is_kms_response_with_plaintext(self, record):  # pylint: disable=no-self-use
        # type: (logging.LogRecord) -> bool
        """Determine if a record contains a KMS response with plaintext.

        :param record: Logging record to filter
        :type record: logging.LogRecord
        :rtype: bool
        """
        try:
            return all((
                record.name == 'botocore.parsers',
                record.msg.startswith('Response body:'),
                b'KeyId' in cast(tuple, record.args)[0],
                b'Plaintext' in cast(tuple, record.args)[0]
            ))
        except Exception:  # pylint: disable=broad-except
            return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号