Skip to content

Commit

Permalink
Now have a log level flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanpeach committed Mar 16, 2024
1 parent 41170d2 commit a455dd1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions dogbarking/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from pathlib import Path
import sys
from typing import Annotated, Optional
from datetime import datetime
import pyaudio
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit a455dd1

Please sign in to comment.