From 2ad8f14b9fd01427a35f97d9024178998b467e43 Mon Sep 17 00:00:00 2001
From: Simon Mazenoux <simon.mazenoux@cern.ch>
Date: Wed, 17 Jan 2024 15:59:30 +0100
Subject: [PATCH] fix log printing in validation notebook

---
 mp3/Validation.ipynb | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/mp3/Validation.ipynb b/mp3/Validation.ipynb
index 0e77152d..7efaa6cf 100644
--- a/mp3/Validation.ipynb
+++ b/mp3/Validation.ipynb
@@ -26,6 +26,7 @@
    "outputs": [],
    "source": [
     "from datetime import datetime\n",
+    "import logging\n",
     "\n",
     "import pandas as pd\n",
     "\n",
@@ -266,10 +267,10 @@
     "        analysis.query()\n",
     "        analysis.analyze()\n",
     "    except AnalysisError as e:\n",
-    "        return (e, False, analysis.get_logs())\n",
+    "        return (e, False, \"\\n\".join([logging.Formatter().format(log) for log in analysis.get_logs()]))\n",
     "    except Exception as e:\n",
-    "        return (e, None, analysis.get_logs())\n",
-    "    return (None, analysis.get_analysis_output(), analysis.get_logs())\n",
+    "        return (e, None, \"\\n\".join([logging.Formatter().format(log) for log in analysis.get_logs()]))\n",
+    "    return (None, analysis.get_analysis_output(), \"\\n\".join([logging.Formatter().format(log) for log in analysis.get_logs()]))\n",
     "\n",
     "\n",
     "tests[\"analysisError\"], tests[\"newAnalysisResult\"], tests[\"capturedOutput\"] = zip(\n",
-- 
GitLab