From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 133401381F3 for ; Sun, 23 Jun 2013 07:14:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1D940E09CB; Sun, 23 Jun 2013 07:14:06 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9A9E7E09CB for ; Sun, 23 Jun 2013 07:14:05 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4077133E699 for ; Sun, 23 Jun 2013 07:13:59 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id EC72DE468F for ; Sun, 23 Jun 2013 07:13:56 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1371961859.11795d9e10e11000dbf36397f4870fed5635bdc8.dol-sen@gentoo> Subject: [gentoo-commits] proj/gentoo-keys:master commit in: gkeyldap/, gkeys/ X-VCS-Repository: proj/gentoo-keys X-VCS-Files: gkeyldap/cli.py gkeys/cli.py gkeys/log.py X-VCS-Directories: gkeyldap/ gkeys/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 11795d9e10e11000dbf36397f4870fed5635bdc8 X-VCS-Branch: master Date: Sun, 23 Jun 2013 07:13:56 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 4cf73283-541f-4bcd-9e98-a61a68135bf4 X-Archives-Hash: 2758e37867cd10355def1c9206628a23 commit: 11795d9e10e11000dbf36397f4870fed5635bdc8 Author: Brian Dolbec gentoo org> AuthorDate: Sat Jun 22 19:41:31 2013 +0000 Commit: Brian Dolbec gmail com> CommitDate: Sun Jun 23 04:30:59 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=11795d9e Make the logger, namespace able. --- gkeyldap/cli.py | 3 +++ gkeys/cli.py | 3 +++ gkeys/log.py | 12 +++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/gkeyldap/cli.py b/gkeyldap/cli.py index 21e551f..8d9dc85 100644 --- a/gkeyldap/cli.py +++ b/gkeyldap/cli.py @@ -7,7 +7,10 @@ import sys import os import argparse +from gkeys import log +log.set_logger('gkeyldap') from gkeys.log import logger + from gkeys.config import GKeysConfig, GKEY from gkeys.seed import Seeds from gkeyldap.search import (LdapSearch, UID, gkey2ldap_map, gkey2SEARCH) diff --git a/gkeys/cli.py b/gkeys/cli.py index b9846d9..47c8777 100644 --- a/gkeys/cli.py +++ b/gkeys/cli.py @@ -16,7 +16,10 @@ from __future__ import print_function import argparse import sys +from gkeys import log +log.set_logger('gkeys') from gkeys.log import logger + from gkeys.config import GKeysConfig, GKEY from gkeys.seed import Seeds diff --git a/gkeys/log.py b/gkeys/log.py index c0a33e7..4608eba 100644 --- a/gkeys/log.py +++ b/gkeys/log.py @@ -14,5 +14,15 @@ import logging logging.basicConfig() -logger = logging.getLogger('gentoo-keys') +NAMESPACE = 'gentoo-keys' +logger = None + +def set_logger(namespace=None): + global logger, NAMESPACE + if not namespace: + namespace = Namespace + else: + NAMESPACE = namespace + logger = logging.getLogger(namespace) +