feat(serverlibrary): add log-level parser function to serverlibrary
This commit is contained in:
1 parent
8517884835
commit
00213a8f70
3 files changed
+11
-7
No files matched your search
@@ -1817,13 +1817,7 @@ def main():
|
|||||||
"-r", "--recursive", action="store_true", help="Process recursively"
|
"-r", "--recursive", action="store_true", help="Process recursively"
|
||||||
)
|
)
|
||||||
|
|
||||||
base_p.add_argument(
|
parser_add_loglevel()
|
||||||
"-ll",
|
|
||||||
"--log-level",
|
|
||||||
type=str.upper,
|
|
||||||
default="INFO",
|
|
||||||
choices=["TRACE", "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],
|
|
||||||
)
|
|
||||||
|
|
||||||
base_p.add_argument(
|
base_p.add_argument(
|
||||||
"--dry-run",
|
"--dry-run",
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ from .core import (
|
|||||||
safe_rename,
|
safe_rename,
|
||||||
score_match_fuzzy,
|
score_match_fuzzy,
|
||||||
score_match_jaccard,
|
score_match_jaccard,
|
||||||
|
parser_add_loglevel,
|
||||||
score_match_recall_jaccard,
|
score_match_recall_jaccard,
|
||||||
setup_logging,
|
setup_logging,
|
||||||
tmdb_get,
|
tmdb_get,
|
||||||
@@ -44,6 +45,7 @@ __all__ = [
|
|||||||
"score_match_fuzzy",
|
"score_match_fuzzy",
|
||||||
"score_match_jaccard",
|
"score_match_jaccard",
|
||||||
"score_match_recall_jaccard",
|
"score_match_recall_jaccard",
|
||||||
|
"parser_add_loglevel",
|
||||||
"setup_logging",
|
"setup_logging",
|
||||||
"tmdb_get",
|
"tmdb_get",
|
||||||
"tvdb_get",
|
"tvdb_get",
|
||||||
|
|||||||
@@ -89,6 +89,14 @@ def setup_logging(log_level: str = "INFO", logfile: str | None = None, no_date:
|
|||||||
root_logger.addHandler(stdout_handler)
|
root_logger.addHandler(stdout_handler)
|
||||||
root_logger.info(f"Set logger to {log_level}, Logfile: {logfile_data}")
|
root_logger.info(f"Set logger to {log_level}, Logfile: {logfile_data}")
|
||||||
|
|
||||||
|
def parser_add_loglevel(parser):
|
||||||
|
parser.add_argument(
|
||||||
|
"-ll",
|
||||||
|
"--log-level",
|
||||||
|
type=str.upper,
|
||||||
|
default="INFO",
|
||||||
|
choices=["TRACE", "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],
|
||||||
|
)
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
# Media Files
|
# Media Files
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
|
|||||||
Reference in new issue
Block a user