1
0
Fork 0

Merge pull request #103 from darikg/logging

fix logging bug: log statements outside pgcli.main not logged to file
This commit is contained in:
Amjith Ramanujam 2015-01-10 16:59:47 -08:00
commit 39a039fb8e
1 changed files with 5 additions and 4 deletions

View File

@ -82,11 +82,12 @@ class PGCli(object):
handler.setFormatter(formatter)
self.logger.addHandler(handler)
self.logger.setLevel(level_map[log_level.upper()])
root_logger = logging.getLogger('pgcli')
root_logger.addHandler(handler)
root_logger.setLevel(level_map[log_level.upper()])
self.logger.debug('Initializing pgcli logging.')
self.logger.debug('Log file "%s".' % log_file)
root_logger.debug('Initializing pgcli logging.')
root_logger.debug('Log file "%s".' % log_file)
def connect_uri(self, uri):
uri = urlparse(uri)