A19grey commited on
Commit
8d15d81
·
1 Parent(s): e0fff0e

Added display of full circuit Hamiltonian and reworked position of tiles

Browse files
Files changed (2) hide show
  1. .gitignore +4 -1
  2. app.py +7 -2
.gitignore CHANGED
@@ -76,4 +76,7 @@ docs/generated/
76
 
77
  # Local development settings
78
  local_settings.py
79
- *.env
 
 
 
 
76
 
77
  # Local development settings
78
  local_settings.py
79
+ *.env
80
+
81
+ # Ignore large log files
82
+ logs/*.log*
app.py CHANGED
@@ -53,13 +53,18 @@ import sys
53
  import json
54
  import os
55
  import logging
 
56
 
57
  # Configure logging
58
  logging.basicConfig(level=logging.DEBUG,
59
  format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
60
  handlers=[
61
- logging.StreamHandler(), # This will output to console
62
- logging.FileHandler('app_molecule.log') # This will output to file
 
 
 
 
63
  ])
64
  logger = logging.getLogger(__name__)
65
  logger.setLevel(logging.DEBUG) # Ensure logger itself is at DEBUG level
 
53
  import json
54
  import os
55
  import logging
56
+ from logging.handlers import RotatingFileHandler
57
 
58
  # Configure logging
59
  logging.basicConfig(level=logging.DEBUG,
60
  format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
61
  handlers=[
62
+ logging.StreamHandler(), # Console output
63
+ RotatingFileHandler(
64
+ 'logs/vqe_simulation.log',
65
+ maxBytes=1024 * 1024, # 1MB per file
66
+ backupCount=3 # Keep 3 backup files
67
+ )
68
  ])
69
  logger = logging.getLogger(__name__)
70
  logger.setLevel(logging.DEBUG) # Ensure logger itself is at DEBUG level