diff --git a/dogbarking/__main__.py b/dogbarking/__main__.py index dfdc9c8..ac1ab2b 100644 --- a/dogbarking/__main__.py +++ b/dogbarking/__main__.py @@ -1,4 +1,5 @@ from pathlib import Path +import sys from typing import Annotated, Optional from datetime import datetime import pyaudio @@ -68,7 +69,22 @@ def nogui( help="The SMTP port to send the email.", envvar="DOGBARKING_SMTP_PORT" ), ] = 465, + log_level: Annotated[ + str, + typer.Option( + help="The logging level to use.", + ), + ] = "INFO", ): + """Dog Barking Alert System""" + + # Set up the logger + logger.remove(0) + logger.add( + sys.stderr, + level=log_level, + ) + # Check that the email details are provided if any of them are provided use_email = any( [sender_email, receiver_email, smtp_password, smtp_server, smtp_port]