Skip to content

Commit

Permalink
fix: Only initializes the logger once to avoid duplicate logs
Browse files Browse the repository at this point in the history
  • Loading branch information
widal001 committed Dec 6, 2024
1 parent 022b6fa commit 9a2b773
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions analytics/src/analytics/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,14 @@
app.add_typer(etl_app, name="etl", help="Transform and load local file")


def init() -> None:
"""Shared init function for all scripts."""
# Setup logging
init_logging(__package__)
init_app(logging.root)
# Setup logging
init_logging(__package__)
init_app(logging.root)


@app.callback()
def callback() -> None:
"""Analyze data about the Simpler.Grants.gov project."""
# If you override this callback, remember to call init()
init()


# Initialize the logger for db-migrate which is exposed directly
# by the db-migrate entrypoint
init()


# ===========================================================
Expand Down

0 comments on commit 9a2b773

Please sign in to comment.