training, local log

This commit is contained in:
Dobromir Popov
2025-10-25 16:21:22 +03:00
parent bd213c44e0
commit 5aa4925cff
4 changed files with 128 additions and 36 deletions

View File

@@ -75,12 +75,23 @@ except ImportError:
HistoricalDataLoader = data_module.HistoricalDataLoader
TimeRangeManager = data_module.TimeRangeManager
# Setup logging
# Setup logging - configure before any logging occurs
log_dir = Path(__file__).parent.parent / 'logs'
log_dir.mkdir(exist_ok=True)
log_file = log_dir / 'annotate_app.log'
# Configure logging to both file and console
# File mode 'w' truncates the file on each run
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
handlers=[
logging.FileHandler(log_file, mode='w'), # Truncate on each run
logging.StreamHandler(sys.stdout) # Also print to console
]
)
logger = logging.getLogger(__name__)
logger.info(f"Logging to: {log_file}")
class AnnotationDashboard:
"""Main annotation dashboard application"""
@@ -1261,6 +1272,11 @@ class AnnotationDashboard:
def main():
"""Main entry point"""
logger.info("=" * 80)
logger.info("ANNOTATE Application Starting")
logger.info(f"Timestamp: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
logger.info("=" * 80)
dashboard = AnnotationDashboard()
dashboard.run(debug=True)