Repository : http://git.fedorahosted.org/cgit/cura-tools.git
On branch : master
commit 71d21c92700df68c5900b230a62b601b9c367f85 Author: Michal Minar miminar@redhat.com Date: Wed Feb 12 12:21:36 2014 +0100
logging: get the logger with name of a module
Allow to configure shell's logging facilities from dependent applications. Using module's name as a name for a logger is a convetion greatly simplifying logging's setup.
cli/lmi/shell/LMIConnection.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/cli/lmi/shell/LMIConnection.py b/cli/lmi/shell/LMIConnection.py index ef83a8a..5d1040b 100644 --- a/cli/lmi/shell/LMIConnection.py +++ b/cli/lmi/shell/LMIConnection.py @@ -71,7 +71,7 @@ def __lmi_raw_input(prompt, use_echo=True): get_input = raw_input stream = sys.stdout if not sys.stderr.isatty() and not sys.stdout.isatty(): - logging.getLogger("").warn( + logging.getLogger(__name__).warn( 'Both stdout and stderr are detached from terminal, using stdout for prompt') if not use_echo: os.system("stty -echo") @@ -140,7 +140,7 @@ def connect(uri, username="", password="", **kwargs): if kwargs: raise TypeError("connect() got an unexpected keyword arguments: %s" % ", ".join(kwargs.keys()))
- logger = logging.getLogger("") + logger = logging.getLogger(__name__) connection = None
# If we are running as root and the scheme has not been explicitly set,
cura-tools-devel@lists.fedorahosted.org