Skip to content

Commit

Permalink
Bugfix: fix debug print
Browse files Browse the repository at this point in the history
  • Loading branch information
derogab committed Oct 31, 2023
1 parent 45842db commit 456d7db
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@
# Load environments from .env
load_dotenv()

# Enable debug
DEBUG = os.getenv('ENABLE_DEBUG')
def debug(*args):
# Get debug value from .env
DEBUG = os.getenv('ENABLE_DEBUG')
# Check if debug is enabled
if DEBUG == "1" or DEBUG.lower() == "true":
# Log
print("[DEBUG]", *args)

def update_ip():
# Get current time
Expand All @@ -27,8 +32,7 @@ def update_ip():
print('[ERROR] No-IP credentials are not set.')
return
# Log
if DEBUG:
print('[DEBUG] Auth: ', HOSTNAME, '/', USER)
debug('Auth: ', HOSTNAME, '/', USER)
# Try to get the IP and update the data on No-IP
try:
# Get the public ip
Expand Down

0 comments on commit 456d7db

Please # to comment.