Adjust logging for tests

This commit is contained in:
thePR0M3TH3AN
2025-07-01 15:16:01 -04:00
parent 74df5f654c
commit d7ea493663
6 changed files with 42 additions and 17 deletions

View File

@@ -21,17 +21,21 @@ try:
# -----------------------------------
APP_DIR = Path.home() / ".seedpass"
APP_DIR.mkdir(exist_ok=True, parents=True) # Ensure the directory exists
logging.info(f"Application directory created at {APP_DIR}")
if logger.isEnabledFor(logging.DEBUG):
logger.info(f"Application directory created at {APP_DIR}")
except Exception as e:
logging.error(f"Failed to create application directory: {e}")
logging.error(traceback.format_exc()) # Log full traceback
if logger.isEnabledFor(logging.DEBUG):
logger.error(f"Failed to create application directory: {e}")
logger.error(traceback.format_exc()) # Log full traceback
try:
PARENT_SEED_FILE = APP_DIR / "parent_seed.enc" # Encrypted parent seed
logging.info(f"Parent seed file path set to {PARENT_SEED_FILE}")
if logger.isEnabledFor(logging.DEBUG):
logger.info(f"Parent seed file path set to {PARENT_SEED_FILE}")
except Exception as e:
logging.error(f"Error setting file paths: {e}")
logging.error(traceback.format_exc()) # Log full traceback
if logger.isEnabledFor(logging.DEBUG):
logger.error(f"Error setting file paths: {e}")
logger.error(traceback.format_exc()) # Log full traceback
# -----------------------------------
# Checksum Files for Integrity
@@ -40,10 +44,12 @@ try:
SCRIPT_CHECKSUM_FILE = (
APP_DIR / "seedpass_script_checksum.txt"
) # Checksum for main script
logging.info(f"Checksum file path set: Script {SCRIPT_CHECKSUM_FILE}")
if logger.isEnabledFor(logging.DEBUG):
logger.info(f"Checksum file path set: Script {SCRIPT_CHECKSUM_FILE}")
except Exception as e:
logging.error(f"Error setting checksum file paths: {e}")
logging.error(traceback.format_exc()) # Log full traceback
if logger.isEnabledFor(logging.DEBUG):
logger.error(f"Error setting checksum file paths: {e}")
logger.error(traceback.format_exc()) # Log full traceback
# -----------------------------------
# Password Generation Constants