Log stderr userland messages from GnuPG at their corresponding log levels.

fix/24-enc-to-file
Isis Lovecruft 2013-10-08 10:14:59 +00:00
parent c26f4d57ac
commit 70c029b2d8
No known key found for this signature in database
GPG Key ID: 5C17776E27F7E84D
1 changed files with 5 additions and 0 deletions

View File

@ -506,6 +506,11 @@ class GPGBase(object):
line = _util._deprefix(line, 'gpg: ')
keyword, value = _util._separate_keyword(line)
# Log gpg's userland messages at our own levels:
if keyword.upper().startswith("WARNING"):
log.warn("%s" % value)
elif keyword.upper().startswith("FATAL"):
log.critical("%s" % value)
else:
if self.verbose:
log.info("%s" % line)