Fix logging config in demo app

The demo application was creating a new logger instance instead of using
the one built into the base class.

Change-Id: I980b180132cf20f7d2420e8f61e341760674aac0
This commit is contained in:
Doug Hellmann 2015-07-09 20:15:01 +00:00
parent d9a0e8c7c1
commit b9f5954b77
1 changed files with 4 additions and 7 deletions

View File

@ -1,4 +1,3 @@
import logging
import sys
from cliff.app import App
@ -7,8 +6,6 @@ from cliff.commandmanager import CommandManager
class DemoApp(App):
log = logging.getLogger(__name__)
def __init__(self):
super(DemoApp, self).__init__(
description='cliff demo app',
@ -17,15 +14,15 @@ class DemoApp(App):
)
def initialize_app(self, argv):
self.log.debug('initialize_app')
self.LOG.debug('initialize_app')
def prepare_to_run_command(self, cmd):
self.log.debug('prepare_to_run_command %s', cmd.__class__.__name__)
self.LOG.debug('prepare_to_run_command %s', cmd.__class__.__name__)
def clean_up(self, cmd, result, err):
self.log.debug('clean_up %s', cmd.__class__.__name__)
self.LOG.debug('clean_up %s', cmd.__class__.__name__)
if err:
self.log.debug('got an error: %s', err)
self.LOG.debug('got an error: %s', err)
def main(argv=sys.argv[1:]):