Skip to content

Commit

Permalink
log: debug prints
Browse files Browse the repository at this point in the history
log: debug prints
  • Loading branch information
luccadibe authored Dec 10, 2024
2 parents 94ad711 + 2f80fe3 commit 70374d0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions backend/internal/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

logger = logging.getLogger(__name__)
logger.info = lambda message: print(message)
logger.exception = lambda message: print(message)

class Engine:
"""
Expand Down
5 changes: 5 additions & 0 deletions backend/internal/experiment_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

logger = logging.getLogger(__name__)
logger.info = lambda message: print(message)
logger.error = lambda message: print(message)
logger.warning = lambda message: print(message)
logger.debug = lambda message: print(message)

class ExperimentManager:
def __init__(self, base_path):
Expand Down Expand Up @@ -108,6 +111,8 @@ def run_experiment(self, experiment_id, output_format, runs):
engine.run(runs=runs, orchestration_timeout=None, randomize=False, accounting=False)
except Exception as e:
logger.error(f"Error running experiment: {e}")
import traceback
logger.error(f"stacktrace: {traceback.format_exc()}")
self.update_experiment(experiment_id, {'status': 'FAILED', 'error_message': str(e)})
finally:
self.release_lock()
Expand Down
4 changes: 4 additions & 0 deletions backend/internal/kubernetes_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
from backend.internal.models.orchestrator import Orchestrator # Import the abstract base class
logger = logging.getLogger(__name__)
logger.info = lambda message: print(message)
logger.error = lambda message: print(message)
logger.warning = lambda message: print(message)
logger.debug = lambda message: print(message)

from backend.internal.errors import OxnException, OrchestratorException, OrchestratorResourceNotFoundException

class KubernetesOrchestrator(Orchestrator):
Expand Down

0 comments on commit 70374d0

Please sign in to comment.