replace print_exceptions with no_exceptions

This commit is contained in:
Rafael Moraes 2024-10-31 13:47:35 -03:00
parent 3998b698e0
commit afbe65707a

View File

@ -125,9 +125,9 @@ def load_config_file(
help="Log level.", help="Log level.",
) )
@click.option( @click.option(
"--print-exceptions", "--no-exceptions",
is_flag=True, is_flag=True,
help="Print exceptions.", help="Don't print exceptions.",
) )
# API specific options # API specific options
@click.option( @click.option(
@ -318,7 +318,7 @@ def main(
no_synced_lyrics: bool, no_synced_lyrics: bool,
config_path: Path, config_path: Path,
log_level: str, log_level: str,
print_exceptions: bool, no_exceptions: bool,
cookies_path: Path, cookies_path: Path,
language: str, language: str,
output_path: Path, output_path: Path,
@ -354,7 +354,7 @@ def main(
) )
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
logger.setLevel(log_level) logger.setLevel(log_level)
logger.debug("Starting downloader") logger.info("Starting Gamdl")
if not cookies_path.exists(): if not cookies_path.exists():
logger.critical(X_NOT_FOUND_STRING.format("Cookies file", cookies_path)) logger.critical(X_NOT_FOUND_STRING.format("Cookies file", cookies_path))
return return
@ -470,7 +470,7 @@ def main(
error_count += 1 error_count += 1
logger.error( logger.error(
f'({url_progress}) Failed to check "{url}"', f'({url_progress}) Failed to check "{url}"',
exc_info=print_exceptions, exc_info=not no_exceptions,
) )
continue continue
for download_index, track_metadata in enumerate( for download_index, track_metadata in enumerate(
@ -762,7 +762,7 @@ def main(
error_count += 1 error_count += 1
logger.error( logger.error(
f'({queue_progress}) Failed to download "{track_metadata["attributes"]["name"]}"', f'({queue_progress}) Failed to download "{track_metadata["attributes"]["name"]}"',
exc_info=print_exceptions, exc_info=not no_exceptions,
) )
finally: finally:
if temp_path.exists(): if temp_path.exists():