From fb835f4f40bd129c664ae718de110179098b38b4 Mon Sep 17 00:00:00 2001 From: hygienic-books Date: Tue, 5 Jul 2022 19:38:53 +0200 Subject: [PATCH] refactor(debug): Increase log level --- .../{{ cookiecutter.__project_slug }}.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python-naive/{{ cookiecutter.__project_slug }}/{{ cookiecutter.__project_slug }}.py b/python-naive/{{ cookiecutter.__project_slug }}/{{ cookiecutter.__project_slug }}.py index 740741c..9dcdbca 100644 --- a/python-naive/{{ cookiecutter.__project_slug }}/{{ cookiecutter.__project_slug }}.py +++ b/python-naive/{{ cookiecutter.__project_slug }}/{{ cookiecutter.__project_slug }}.py @@ -212,8 +212,8 @@ def validate_config_sections( sys.exit(7) if not set(CONST.CFG_MANDATORY).issubset(config_obj.options(this_section, no_defaults=True)): - {% if cookiecutter.use_rich_logging == "yes" -%}log.debug{%- else -%}print{%- endif %}(f"Config section '[{this_section}]' does not have all mandatory options " - {% if cookiecutter.use_rich_logging == "yes" %} {% endif %}f"{CONST.CFG_MANDATORY} set, skipping section ...") + {% if cookiecutter.use_rich_logging == "yes" -%}log.warning{%- else -%}print{%- endif %}(f"Config section '[{this_section}]' does not have all mandatory options " + {% if cookiecutter.use_rich_logging == "yes" %} {% endif %}f"{CONST.CFG_MANDATORY} set, skipping section ...") config_obj.remove_section(this_section) else: for key in config_obj.options(this_section, no_defaults=True): @@ -254,13 +254,13 @@ if __name__ == "__main__": if config_has_valid_section(config): validate_config_sections(config) else: - {% if cookiecutter.use_rich_logging == "yes" -%}log.debug{%- else -%}print{%- endif %}(f"No valid config section found. A valid config section has at least the mandatory options " + {% if cookiecutter.use_rich_logging == "yes" -%}log.error{%- else -%}print{%- endif %}(f"No valid config section found. A valid config section has at least the mandatory options " {% if cookiecutter.use_rich_logging == "yes" %} {% endif %}f"{CONST.CFG_MANDATORY} set. Exiting 2 ...") sys.exit(2) {% if cookiecutter.use_rich_logging == "yes" -%}log.debug{%- else -%}print{%- endif %}(f"Iterating over config sections ...") for section in config.sections(): - {% if cookiecutter.use_rich_logging == "yes" -%}log.debug{%- else -%}print{%- endif %}(f"Processing section '[{section}]' ...") + {% if cookiecutter.use_rich_logging == "yes" -%}log.info{%- else -%}print{%- endif %}(f"Processing section '[{section}]' ...") # ... {%- else -%} pass