From dbab28a2187993d986c195909f8368e527a2776a Mon Sep 17 00:00:00 2001 From: Willard Nilges Date: Sun, 1 Mar 2026 15:05:45 -0500 Subject: [PATCH 1/2] log exceptions instead of printing them in starrs.py --- proxstar/starrs.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/proxstar/starrs.py b/proxstar/starrs.py index f5c92ab..783950a 100644 --- a/proxstar/starrs.py +++ b/proxstar/starrs.py @@ -1,3 +1,8 @@ + +import logging + +logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.INFO) + def get_next_ip(starrs, range_name): c = starrs.cursor() try: @@ -7,7 +12,7 @@ def get_next_ip(starrs, range_name): results = c.fetchall() c.execute('COMMIT') except Exception as e: - print(e) + logging.exception(e) starrs.rollback() finally: c.close() @@ -23,7 +28,7 @@ def get_ip_for_mac(starrs, mac): results = c.fetchall() c.execute('COMMIT') except Exception as e: - print(e) + logging.exception(e) starrs.rollback() finally: c.close() @@ -41,7 +46,7 @@ def renew_ip(starrs, addr): results = c.fetchall() c.execute('COMMIT') except Exception as e: - print(e) + logging.exception(e) starrs.rollback() finally: c.close() @@ -79,7 +84,7 @@ def check_hostname(starrs, hostname): available = False c.execute('COMMIT') except Exception as e: - print(e) + logging.exception(e) valid = False available = False starrs.rollback() @@ -104,7 +109,7 @@ def register_starrs(starrs, name, owner, mac, addr): c.callproc('api.modify_system', (name, 'comment', f'Owned by {owner}')) c.execute('COMMIT') except Exception as e: - print(e) + logging.exception(e) starrs.rollback() finally: c.close() @@ -120,7 +125,7 @@ def delete_starrs(starrs, name): results = c.fetchall() c.execute('COMMIT') except Exception as e: - print(e) + logging.exception(e) starrs.rollback() finally: c.close() From 525a01f4d9cac85fcb68df2bad1c61ee1d76f4c1 Mon Sep 17 00:00:00 2001 From: Willard Nilges Date: Sun, 1 Mar 2026 15:15:53 -0500 Subject: [PATCH 2/2] placate robots --- proxstar/starrs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxstar/starrs.py b/proxstar/starrs.py index 783950a..84d1ff2 100644 --- a/proxstar/starrs.py +++ b/proxstar/starrs.py @@ -1,8 +1,8 @@ - import logging logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.INFO) + def get_next_ip(starrs, range_name): c = starrs.cursor() try: