Change logger format for debug level and fixes

This commit is contained in:
Cédric Leporcq 2021-10-18 20:48:23 +02:00
parent 4324470be0
commit 374f64d8b1
2 changed files with 8 additions and 3 deletions

View File

@ -428,10 +428,10 @@ class Collection:
self.logger.info(f'File {dest_path} already sorted')
return None
elif dest_path.is_dir():
self.logger.warning(f'File {dest_path} is a existing directory')
self.logger.info(f'File {dest_path} is a existing directory')
return False
elif dest_path.is_file():
self.logger.warning(f'File {dest_path} already exist')
self.logger.info(f'File {dest_path} already exist')
if remove_duplicates:
if filecmp.cmp(src_path, dest_path):
self.logger.info(

View File

@ -11,7 +11,12 @@ def level(verbose, debug):
def get_logger(name='ordigi', level=30):
logging.basicConfig(format='%(levelname)s:%(message)s', level=level)
if level > 10:
format='%(levelname)s:%(message)s'
else:
format='%(levelname)s:%(name)s:%(message)s'
logging.basicConfig(format=format, level=level)
logging.getLogger('asyncio').setLevel(level)
logger = logging.getLogger(name)
return logger