remove debug_output, all goes to logs now

This commit is contained in:
2025-10-02 12:41:25 -06:00
parent d10869dd3e
commit dd02f0250c
3 changed files with 462 additions and 314 deletions

View File

@@ -20,8 +20,7 @@ log_file = os.path.join(log_dir, f"check_{datetime.now().strftime('%Y%m%d_%H%M%S
logging.basicConfig(filename=log_file, level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
def write_debug_info(message):
with open("debug_output.txt", "a", encoding='utf-8') as f:
f.write(f"{message}\n")
logging.info(message)
def get_file_info(file_path):
try:
@@ -107,9 +106,8 @@ def check_file(input_path, output_path):
return f"Error checking file: {str(e)}"
def main():
# Clear previous debug output
with open("debug_output.txt", "w", encoding='utf-8') as f:
f.write("=== Debug Output ===\n")
# Start debug section in the log file
logging.info("=== Debug Output ===")
input_dir = "input"
output_dir = "output"
@@ -139,7 +137,7 @@ def main():
# Try to list contents using different methods
write_debug_info("\nTrying 'dir' command:")
try:
result = subprocess.run(['dir', input_dir], capture_output=True, text=True)
result = subprocess.run(['cmd', '/c', 'dir', input_dir], capture_output=True, text=True)
write_debug_info("Input directory contents (dir command):")
write_debug_info(result.stdout)
except Exception as e:
@@ -162,8 +160,8 @@ def main():
except Exception as e:
write_debug_info(f"Error with Path.iterdir: {str(e)}")
print("\nDebug information has been written to debug_output.txt")
print("Please check that file to see what's actually in the directories")
print(f"\nDebug information has been written to {log_file}")
print("Please check that log to see what's actually in the directories")
# Continue with the rest of the script...
print("\nChecking files for inconsistencies...")