Skip to content

Commit

Permalink
add flag to show verbose output and log output under one name
Browse files Browse the repository at this point in the history
  • Loading branch information
elfkuzco committed Apr 1, 2024
1 parent 4ac977c commit a78febd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gutenberg2zim/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"datatables/datatables.min.js",
]

logger = getLogger(__name__, level=logging.DEBUG)
logger = getLogger(NAME, level=logging.INFO)

TMP_FOLDER = "tmp"
TMP_FOLDER_PATH = pathlib.Path(TMP_FOLDER)
10 changes: 9 additions & 1 deletion src/gutenberg2zim/entrypoint.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging

Check warning on line 1 in src/gutenberg2zim/entrypoint.py

View check run for this annotation

Codecov / codecov/patch

src/gutenberg2zim/entrypoint.py#L1

Added line #L1 was not covered by tests
import os
import sys

Expand All @@ -22,7 +23,8 @@
"""[--prepare] [--parse] [--download] [--export] [--dev] """
"""[--zim] [--complete] [-m ONE_LANG_ONE_ZIM_FOLDER] """
"""[--title-search] [--bookshelves] [--optimization-cache S3URL] """
"""[--stats-filename STATS_FILENAME] [--publisher ZIM_PUBLISHER]"""
"""[--stats-filename STATS_FILENAME] [--publisher ZIM_PUBLISHER] """
"""[--debug]"""
"""
-h --help Display this help message
Expand Down Expand Up @@ -64,6 +66,7 @@
"""optimization cache
--stats-filename=<filename> Path to store the progress JSON file to
--publisher=<zim_publisher> Custom Publisher in ZIM Metadata (openZIM otherwise)
--debug Enable verbose output
This script is used to produce a ZIM file (and any intermediate state)
of Gutenberg repository using a mirror."""
Expand Down Expand Up @@ -104,6 +107,11 @@ def main():
use_any_optimized_version = arguments.get("--use-any-optimized-version", False)
stats_filename = arguments.get("--stats-filename") or None
publisher = arguments.get("--publisher") or "openZIM"
debug = arguments.get("--debug") or False

Check warning on line 110 in src/gutenberg2zim/entrypoint.py

View check run for this annotation

Codecov / codecov/patch

src/gutenberg2zim/entrypoint.py#L110

Added line #L110 was not covered by tests

if debug:
for handler in logger.handlers:
handler.setLevel(logging.DEBUG)

Check warning on line 114 in src/gutenberg2zim/entrypoint.py

View check run for this annotation

Codecov / codecov/patch

src/gutenberg2zim/entrypoint.py#L114

Added line #L114 was not covered by tests

s3_storage = None
if optimization_cache:
Expand Down

0 comments on commit a78febd

Please sign in to comment.