From 36eccd04fc331ec44df5b6b0e7f51996cac20c7d Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 20 Sep 2012 07:05:37 -0400 Subject: [PATCH] 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`). --- pgp_mime/crypt.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) -- 2.26.2