mirror of https://github.com/dbcli/pgcli
fix file logging bug: only log statements from pgcli.main were logged to file. attach file handler to the root pgcli instead of pgcli.main
This commit is contained in:
parent
78819664cd
commit
89363a15bc
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue