From: W. Trevor King Date: Thu, 20 Sep 2012 11:05:37 +0000 (-0400) Subject: crypt: Use a sublogger of pgp_mime.LOG not pyassuan.LOG for clients. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=36eccd04fc331ec44df5b6b0e7f51996cac20c7d;p=pgp-mime.git crypt: Use a sublogger of pgp_mime.LOG not pyassuan.LOG for clients. This way tools like pygrader that setup a SysLogHandler for pgp_mime.LOG wont have pyassuan still logging to the console. The name-order for the logger also changed (from `pyassuan.pgp-mime` to `pgp-mime.pyassuan`). --- diff --git a/pgp_mime/crypt.py b/pgp_mime/crypt.py index b3c29e7..82a0cac 100644 --- a/pgp_mime/crypt.py +++ b/pgp_mime/crypt.py @@ -46,8 +46,10 @@ def connect(client, filename, **kwargs): return socket def get_client(**kwargs): - client = _client.AssuanClient(name='pgp-mime', close_on_disconnect=True) - client.logger.setLevel(_LOG.level) + logger = _logging.getLogger('{}.{}'.format(_LOG.name, 'pyassuan')) + client = _client.AssuanClient( + name='pgp-mime', logger=logger, use_sublogger=False, + close_on_disconnect=True) socket = connect(client, '~/src/gpgme/build/src/gpgme-tool', **kwargs) #socket = connect(client, '~/.assuan/S.gpgme-tool', **kwargs) return (client, socket)